autovacuum_naptime
Fact — official short description: “Time to sleep between autovacuum runs.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG9.0–19 Beta 3 | 60 |
s |
1 min |
How it works
Time to sleep between autovacuum runs. A configuration reload applies a new value; existing work already in flight is not retroactively changed.
The launcher aims to start work in each database once per interval; with N databases, launch attempts are spread at roughly naptime/N. It is not a fixed per-table polling period, and worker availability plus long-running jobs can add delay.
Monitor and change autovacuum_naptime together with autovacuum, autovacuum_max_workers, autovacuum_worker_slots. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Tune autovacuum_naptime 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. |
| 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. |
| Small nodes | Start with upstream or the measured Pigsty matrix value. Fixed thresholds dominate on small tables; after changes, confirm worker and I/O headroom. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | 1min |
same as boot | 1min |
| OLAP | 1min |
same as boot | 1min |
| CRIT | 1min |
same as boot | 1min |
| TINY | 1min |
same as boot | 1min |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 = 1min (dcs); OLAP: PG9.0–19 Beta 3 = 1min (dcs); CRIT: PG9.0–19 Beta 3 = 1min (dcs); TINY: PG9.0–19 Beta 3 = 1min (dcs). Advice, pending human review — Editorial interpretation, pending human maintainer review: the override appears intended to retain PostgreSQL’s one-minute database scheduling cadence explicitly; confirm it against the current Pigsty templates, hardware fixture, and operational guarantees before publication.
Common pitfalls
- 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.
Related parameters
autovacuum · autovacuum_max_workers · autovacuum_worker_slots · autovacuum_work_mem · track_counts · autovacuum_analyze_scale_factor