From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow changing autovacuum_max_workers without restarting.
Date: Mon, 06 Jan 2025 21:02:10 +0000
Message-ID: <E1tUuEj-000Cyr-TE@gemulon.postgresql.org> (raw)
Allow changing autovacuum_max_workers without restarting.
This commit introduces a new parameter named
autovacuum_worker_slots that controls how many autovacuum worker
slots to reserve during server startup. Modifying this new
parameter's value does require a server restart, but it should
typically be set to the upper bound of what you might realistically
need to set autovacuum_max_workers. With that new parameter in
place, autovacuum_max_workers can now be changed with a SIGHUP
(e.g., pg_ctl reload).
If autovacuum_max_workers is set higher than
autovacuum_worker_slots, a WARNING is emitted, and the server will
only start up to autovacuum_worker_slots workers at a given time.
If autovacuum_max_workers is set to a value less than the number of
currently-running autovacuum workers, the existing workers will
continue running, but no new workers will be started until the
number of running autovacuum workers drops below
autovacuum_max_workers.
Reviewed-by: Sami Imseih, Justin Pryzby, Robert Haas, Andres Freund, Yogesh Sharma
Discussion: https://postgr.es/m/20240410212344.GA1824549%40nathanxps13
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c758119e5bfb47b38cf957f9a5a37ceae96fa9b3
Modified Files
--------------
doc/src/sgml/config.sgml | 28 ++++++++-
doc/src/sgml/runtime.sgml | 4 +-
src/backend/access/transam/xlog.c | 2 +-
src/backend/postmaster/autovacuum.c | 82 +++++++++++++++++++++------
src/backend/postmaster/pmchild.c | 4 +-
src/backend/storage/lmgr/proc.c | 6 +-
src/backend/utils/init/postinit.c | 6 +-
src/backend/utils/misc/guc_tables.c | 11 +++-
src/backend/utils/misc/postgresql.conf.sample | 3 +-
src/include/postmaster/autovacuum.h | 1 +
src/test/perl/PostgreSQL/Test/Cluster.pm | 1 +
11 files changed, 117 insertions(+), 31 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Allow changing autovacuum_max_workers without restarting.
In-Reply-To: <E1tUuEj-000Cyr-TE@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox