Re: allow changing autovacuum_max_workers without restarting

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: allow changing autovacuum_max_workers without restarting
Date: 2025-01-06 23:20:22
Message-ID: Z3xlNmC3qtwf1lz1@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 06, 2025 at 05:36:17PM -0500, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> 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.
>
> That might be a good compromise.

+1, I like the idea.

> You'd have to think about how
> it should interact with initdb's probes for workable values of
> max_connections. My first thought about that is to have initdb
> set autovacuum_worker_slots to max_connections / 8 or thereabouts
> as it works down the list of max_connections values to try. Or
> you could do something more complicated, but I don't see a reason
> to make it too complex.

My first instinct was just to set it to the lowest default we'd consider
during the max_connections tests (which I'm assuming is 3 due to the
current default for autovacuum_max_workers). That way, the max_connections
default won't change from version to version on affected systems, but you
might get some extra autovacuum slots.

--
nathan

Attachment Content-Type Size
v1-0001-Lower-default-value-of-autovacuum_worker_slots-in.patch text/plain 4.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-01-06 23:36:43 Re: allow changing autovacuum_max_workers without restarting
Previous Message Tom Lane 2025-01-06 22:46:19 Re: Alias of VALUES RTE in explain plan