Re: allow changing autovacuum_max_workers without restarting
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: "Imseih (AWS), Sami" <simseih@amazon.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-04-11T14:58:34Z
Lists: pgsql-hackers
On Thu, Apr 11, 2024 at 09:42:40AM -0500, Nathan Bossart wrote: > On Thu, Apr 11, 2024 at 02:24:18PM +0000, Imseih (AWS), Sami wrote: >> max_worker_processes defines a pool of max # of background workers allowed. >> parallel workers and extensions that spin up background workers all utilize from >> this pool. >> >> Should autovacuum_max_workers be able to utilize from max_worker_processes also? >> >> This will allow autovacuum_max_workers to be dynamic while the user only has >> to deal with an already existing GUC. We may want to increase the default value >> for max_worker_processes as part of this. > > My concern with this approach is that other background workers could use up > all the slots and prevent autovacuum workers from starting, unless of > course we reserve autovacuum_max_workers slots for _only_ autovacuum > workers. I'm not sure if we want to get these parameters tangled up like > this, though... I see that the logical replication launcher process uses this pool, but we take special care to make sure it gets a slot: /* * Register the apply launcher. It's probably a good idea to call this * before any modules had a chance to take the background worker slots. */ ApplyLauncherRegister(); I'm not sure there's another way to effectively reserve slots that would work for the autovacuum workers (which need to restart to connect to different databases), so that would need to be invented. We'd probably also want to fail startup if autovacuum_max_workers < max_worker_processes, which seems like it has the potential to cause problems when folks first upgrade to v18. Furthermore, we might have to convert autovacuum workers to background worker processes for this to work. I've admittedly wondered about whether we should do that eventually, anyway, but it'd expand the scope of this work quite a bit. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Give up on running with NetBSD/OpenBSD's default semaphore settings.
- 810a8b1c8051 18.0 landed
-
initdb: Do not report default autovacuum_worker_slots.
- 2b49492eda3f 18.0 landed
-
Lower default value of autovacuum_worker_slots in initdb as needed.
- 6d01541960e2 18.0 landed
-
Allow changing autovacuum_max_workers without restarting.
- c758119e5bfb 18.0 landed
-
Reserve a PGPROC slot and semaphore for the slotsync worker process.
- 2bdf1b2a2efc 18.0 cited
-
Make archiver process an auxiliary process.
- d75288fb27b8 14.0 cited
-
Correct the formulas for System V IPC parameters SEMMNI and SEMMNS in docs.
- 597f7e3a6ec3 9.6.0 cited