Re: Reducing power consumption on idle servers

Chapman Flack <chap@anastigmatix.net>

From: Chapman Flack <chap@anastigmatix.net>
To: Simon Riggs <simon.riggs@enterprisedb.com>, Andres Freund <andres@anarazel.de>, Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2022-02-21T16:49:11Z
Lists: pgsql-hackers
Hi,

On 02/21/22 11:11, Simon Riggs wrote:
> This patch seeks to change the situation for the better in PG15, i.e.
> soon, so the changes proposed are deliberately light. It also seeks to
> provide a framework that writers of background worker processes can
> follow, since we can't just fix core, we need to fix all the various
> bgworkers in use as well.

I think there might be a typo in the worker_spi.c example:

+	/*
+	 * Use the standard design pattern for wait time/hibernation.
+	 * After 50 consecutive loops with work_done=true the wait time
+	 * will be set to the standard hibernation timeout of 60s.
+	 */
+	SET_DELAY_OR_HIBERNATE(work_done, worker_spi_naptime * 1000L);


Shouldn't the comment be "with work_done=false" ?

Regards,
-Chap



Commits

  1. Remove promote_trigger_file.

  2. Add pg_promote function

  3. pg_ctl promote