autovacuum_worker_slots
Read PG 18 manual ↗Specifies the number of backend slots to reserve for autovacuum worker processes.
- Type
- integer
- Context
- postmaster
- Measured default
- 16
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Specifies the number of backend slots to reserve 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.
When changing this value, consider also adjusting autovacuum_max_workers.
Measured default history
| Version interval | Default |
|---|---|
| 18 – 19 | 16 |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
Sets the number of backend slots to allocate for autovacuum workers. The value is fixed when the server starts, so changing it requires a restart.
PG18 separates the startup allocation of backend slots for autovacuum workers from the active concurrency limit autovacuum_max_workers. The slots are reserved at startup so the worker limit can be reloaded within that allocation.
Monitor and change autovacuum_worker_slots together with autovacuum, autovacuum_naptime, autovacuum_max_workers. Validate on the relevant server role and real workload, then use its postmaster context to choose session change, reload, or restart; a historical boot default is not the current effective value.
Operational considerations
Changing the global value while a table storage parameter overrides it.
Treating reltuples and cumulative change statistics as exact real-time counts.
Blaming a threshold without checking long transactions, replication slots, and worker saturation.
Buying short-term quiet by deferring maintenance until wraparound failsafe activates.
Workload guidance
OLAP: Run explicit ANALYZE/VACUUM after bulk loads instead of waiting only for proportional triggers; plan freezing and visibility-map advancement separately for append-only partitions.
OLTP: Tune autovacuum_worker_slots from table size, change rate, and maintenance SLA, using per-table thresholds for large/hot relations. Observe trigger intervals, dead tuples, and ANALYZE/VACUUM duration.
SMALL: Start with upstream. Fixed thresholds dominate on small tables; after changes, confirm worker and I/O headroom.
Version history 1
- PG 17 → 18added
Related entries
Further reading
Definition snapshot: english-manuals:d49200fde6900f1326cfb20574c… · English manual source