Skip to content

vacuum_cost_limit

vacuum_cost_limit — Vacuum cost amount available before napping. Observed in PG9.0–19 Beta 3; its last measured boot default is 200 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
Note

Fact — official short description: “Vacuum cost amount available before napping.”

Identity

Type , Valueinteger
Upstream pg_settings type
Context , Valueuser
Settable by an ordinary user
Unit , Value
Raw unit
Range , Value110000
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueVacuuming / Cost-Based Vacuum Delay
Upstream classification
Latest boot value , Value200
200

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

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.0–19 Beta 3 200 200

How it works

Vacuum cost amount available before napping. It can be changed at session scope, so different sessions may observe different behavior.

VACUUM accumulates virtual cost for page hits, misses, and dirties; after the balance reaches vacuum_cost_limit it sleeps for vacuum_cost_delay and resets. This is coarse I/O pacing rather than an exact bandwidth cap, and the wraparound failsafe bypasses throttling.

Monitor and change vacuum_cost_limit together with vacuum_cost_delay, vacuum_cost_page_hit, vacuum_cost_page_miss. Validate on the relevant server role and real workload, then use its user context to choose session change, reload, or restart; a historical boot default is not the current effective value.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Tune vacuum_cost_limit from autovacuum duration, dead-tuple growth, and foreground I/O latency together. Prefer per-table overrides for hotspots; global throttling must not let cleanup fall permanently behind.
OLAP During post-load windows, a larger budget or shorter delay can improve maintenance throughput, but verify that scans do not starve queries/imports. Failsafe activation means normal pacing already failed.
Small nodes Keep conservative defaults. On slow disks, lowering concurrency or overriding one table is usually more controllable than making the delay arbitrarily large.

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 2000 different 2000
OLAP 10000 different 10000
CRIT 2000 different 2000
TINY 2000 different 2000
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 = 2000 (dcs); OLAP: PG9.0–19 Beta 3 = 10000 (dcs); CRIT: PG9.0–19 Beta 3 = 2000 (dcs); TINY: PG9.0–19 Beta 3 = 2000 (dcs). Advice, pending human review — Editorial interpretation, pending human maintainer review: the override appears intended to pair the delay with a much larger work budget, especially for OLAP maintenance; 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.

vacuum_cost_delay · vacuum_cost_page_hit · vacuum_cost_page_miss · vacuum_cost_page_dirty · autovacuum_vacuum_cost_delay · autovacuum_vacuum_cost_limit

References