Re: Reducing power consumption on idle servers

Simon Riggs <simon.riggs@enterprisedb.com>

From: Simon Riggs <simon.riggs@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Andres Freund <andres@anarazel.de>, Zheng Li <zhengli10@gmail.com>, Jim Nasby <nasbyj@amazon.com>, Thomas Munro <thomas.munro@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-11-13T16:51:50Z
Lists: pgsql-hackers

Attachments

On Thu, 24 Mar 2022 at 16:02, Simon Riggs <simon.riggs@enterprisedb.com> wrote:
>
> On Thu, 24 Mar 2022 at 15:39, Robert Haas <robertmhaas@gmail.com> wrote:
> >
> > On Thu, Mar 24, 2022 at 6:59 AM Simon Riggs
> > <simon.riggs@enterprisedb.com> wrote:
> > > The proposals of this patch are the following, each of which can be
> > > independently accepted/rejected:
> > > 1. fix the sleep pattern of bgwriter, walwriter and logical worker
> > > (directly affects powersave)
> > > 2. deprecate promote_trigger_file, which then allows us to fix the
> > > sleep for startup process (directly affects powersave)
> > > 3. treat hibernation in all procs the same, for simplicity, and to
> > > make sure we don't forget one later
> > > 4. provide a design pattern for background worker extensions to
> > > follow, so as to encourage powersaving
> >
> > Unfortunately, the patch isn't split in a way that corresponds to this
> > division. I think I'm +1 on change #2 -- deprecating
> > promote_trigger_file seems like a good idea to me independently of any
> > power-saving considerations. But I'm not sure that I am on board with
> > any of the other changes.
>
> OK, so change (2) is good. Separate patch attached.

Thanks to Ian for prompting me to pick up this thread again; apologies
for getting distracted.

The attached patch is a reduced version of the original. It covers only:
* deprecation of the promote_trigger_file - there are no tests that
use that, hence why there is no test coverage for the patch
* changing the sleep time of the startup process to 60s
* docs and comments

Other points will be discussed in another branch of this thread.

-- 
Simon Riggs                http://www.EnterpriseDB.com/

Commits

  1. Remove promote_trigger_file.

  2. Add pg_promote function

  3. pg_ctl promote