Re: allow changing autovacuum_max_workers without restarting

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org, "Imseih (AWS), Sami" <simseih@amazon.com>, Justin Pryzby <pryzby@telsasoft.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-04-29T17:31:55Z
Lists: pgsql-hackers
I wrote:
> Andres seemed lukewarm about reverting 38da05346 or 6d0154196, so
> I left it be for the moment.  But I still feel the argument is good
> that "these will do little except confuse future hackers".  Barring
> objection, I'll go revert them.

Actually ... on looking again at 6d0154196 ("Lower default value of
autovacuum_worker_slots in initdb as needed"), it doesn't look that
silly.  If we're unable to allocate max_connections = 100, turning
it down while still insisting on 16 AV worker slots doesn't seem
terribly sane.  Maybe we'd choose a formula other than
"(max_connections / 6)" if we were doing it afresh, but not scaling
autovacuum_worker_slots at all doesn't seem like the best answer.

So now I'm inclined to leave that one alone.  I'd still revert
38da05346, which means the comment added by 6d0154196 needs some minor
adjustments.  But I think we can stick with the "(max_connections /
6)" formula --- it will produce 3 with trial_conns = 20, but that's
enough.

			regards, tom lane



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Give up on running with NetBSD/OpenBSD's default semaphore settings.

  2. initdb: Do not report default autovacuum_worker_slots.

  3. Lower default value of autovacuum_worker_slots in initdb as needed.

  4. Allow changing autovacuum_max_workers without restarting.

  5. Reserve a PGPROC slot and semaphore for the slotsync worker process.

  6. Make archiver process an auxiliary process.

  7. Correct the formulas for System V IPC parameters SEMMNI and SEMMNS in docs.