select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / VACUUMING

vacuum_cost_page_dirty

Read PG 18 manual ↗

The estimated cost charged when vacuum modifies a block that was previously clean.

Type
integer
Context
user
Measured default
20
Unit
Metadata snapshot
18

Definition PG 18 manual

The estimated cost charged when vacuum modifies a block that was previously clean. It represents the extra I/O required to flush the dirty block out to disk again. The default value is 20.

Measured default history
Version intervalDefault
9.0 – 1920
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

Vacuum cost for a page dirtied by vacuum. 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_page_dirty together with vacuum_cost_delay, vacuum_cost_limit, vacuum_cost_page_hit. 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.

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: 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.

OLTP: Tune vacuum_cost_page_dirty 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.

SMALL: Keep conservative defaults. On slow disks, lowering concurrency or overriding one table is usually more controllable than making the delay arbitrarily large.

Version history 1
  1. PG 17 → 18changed

Related entries

Further reading

Definition snapshot: english-manuals:ec5efa82db683df3152960a6ec1… · English manual source