Re: allow changing autovacuum_max_workers without restarting

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@lists.postgresql.org, Nathan Bossart <nathandbossart@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: "Imseih (AWS), Sami" <simseih@amazon.com>, Justin Pryzby <pryzby@telsasoft.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2025-01-06T22:17:38Z
Lists: pgsql-hackers
Hi, 

On January 6, 2025 5:15:25 PM EST, Nathan Bossart <nathandbossart@gmail.com> wrote:
>On Mon, Jan 06, 2025 at 03:50:24PM -0600, Nathan Bossart wrote:
>> I'm obviously biased, but I think it would be unfortunate to block features
>> like this one because of low settings that would otherwise be unsuitable
>> for any reasonable production workload.  If we do want to at least support
>> check-world on these systems, another option could be to simply lower the
>> default of autovacuum_worker_slots to 7 (or maybe lower).  Of course, that
>> only helps until the next time more semaphores are required, but that's not
>> a new problem.
>
>I've attached a patch to lower the default to 5.  That at least gives a
>little bit of wiggle room for autovacuum_max_workers (and for a couple of
>new auxiliary processes).  FWIW the reason I originally set the default to
>16 was to prevent most users from ever needing to think about adjusting
>autovacuum_worker_slots (which requires a restart and is a completely new
>parameter that most will be unfamiliar with).

How about trying the higher setting first in initdb? On any sane system that won't cost anything because it'll succeed with the higher value.

Greetings, 

Andres
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



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.