Re: [PATCH] doc: Fix autovacuum_max_workers and autovacuum_worker_slots descriptions

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: joaovictor(dot)rito(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] doc: Fix autovacuum_max_workers and autovacuum_worker_slots descriptions
Date: 2026-11-19 02:54:15
Message-ID: 20261119.115415.218157216746560848.horikyota.ntt@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

At Wed, 18 Nov 2026 21:45:20 -0300, Joao Rito <joaovictor(dot)rito(at)gmail(dot)com> wrote in
> The documentation for autovacuum_max_workers says that a value higher than
> autovacuum_worker_slots has no effect. In fact, check_av_worker_gucs()
> reports a WARNING in that case, and the server starts at most
> autovacuum_worker_slots workers.
>
> Also document that slots beyond autovacuum_max_workers are kept in
> reserve (see av_worker_available()), so autovacuum_max_workers can be
> raised with a configuration reload, up to autovacuum_worker_slots.
> This is the purpose of autovacuum_worker_slots, as described in the
> message of commit c758119e5.

I agree with the general direction of the proposal. However, I don't
think it's necessary to document when the WARNING is issued, since the
existing documentation already explains that values exceeding the
limit have no effect.

I think revising the existing text, rather than simply adding new
text, would make the proposed changes more concise and easier to
understand.

Also, the current term "backend slots" might give the misleading
impression that these slots are included in max_connections, so I
think it would be better to change "backend slots to reserve for" to
"slots to allocate for" in the description of autovacuum_worker_slots.

For the same reason, I think "backend slots" should also be changed to
"slots" in the short_desc entry in guc_parameters.dat.

The changes would look something like this:

====
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 886e8c44847..726d52afa31 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -9499,14 +9499,16 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
</term>
<listitem>
<para>
- Specifies the number of backend slots to reserve for autovacuum worker
+ Specifies the number of slots to allocate for autovacuum worker
processes. The default is typically 16 slots, but might be less if
your kernel settings will not support it (as determined during initdb).
This parameter can only be set at server start.
</para>
<para>
- When changing this value, consider also adjusting
- <xref linkend="guc-autovacuum-max-workers"/>.
+ Setting this parameter higher than
+ <xref linkend="guc-autovacuum-max-workers"/> allows it to be
+ increased up to this value by reloading the configuration without
+ restarting the server.
</para>
</listitem>
</varlistentry>
diff --git a/src/backend/utils/misc/guc_parameters.dat b/src/backend/utils/misc/guc_parameters.dat
index 184fcf49080..3c2b7c32198 100644
--- a/src/backend/utils/misc/guc_parameters.dat
+++ b/src/backend/utils/misc/guc_parameters.dat
@@ -294,7 +294,7 @@

# see max_connections
{ name => 'autovacuum_worker_slots', type => 'int', context => 'PGC_POSTMASTER', group => 'VACUUM_AUTOVACUUM',
- short_desc => 'Sets the number of backend slots to allocate for autovacuum workers.',
+ short_desc => 'Sets the number of slots to allocate for autovacuum workers.',
variable => 'autovacuum_worker_slots',
boot_val => '16',
min => '1',
====

Regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-11-19 03:01:31 Re: Long reloption values are truncated by pg_dump and pg_get_indexdef()
Previous Message Hayato Kuroda (Fujitsu) 2026-11-19 01:59:32 RE: [PATCH] pg_upgrade: add hints to wal_level and max_replication_slots checks