Skip to content

min_wal_size

min_wal_size — Sets the minimum size to shrink the WAL to. Observed in PG9.5–19 Beta 3; its last measured boot default is 80 MiB in PG19 Beta 3, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
Note

Fact — official short description: “Sets the minimum size to shrink the WAL to.”

Identity

Type , Valueinteger
Upstream pg_settings type
Context , Valuesighup
Takes effect after configuration reload
Unit , ValueMB
Raw unit
Range , Value22147483647
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueWrite-Ahead Log / Checkpoints
Upstream classification
Latest boot value , Value80
80 MiB

Lifecycle

Fact Value
First observed PG9.5
Present in PG9.5–19 Beta 3
Removed in No
Introduction commit 88e982302684 — Replace checkpoint_segments with min_wal_size and max_wal_size.
Commit date 2015-02-23
Discussion

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.5–9.6 5 16MB 80 MiB (5 × 16MB)
PG10–19 Beta 3 80 MB 80 MiB

How it works

Sets the minimum size to shrink the WAL to. A configuration reload applies a new value; existing work already in flight is not retroactively changed.

Below this floor, checkpoint recycling keeps old segment files ready for reuse instead of removing them. It is a retained/recycled space floor, not a cap; archive failures, replication slots, wal_keep_size, and max_wal_size can all make pg_wal much larger.

Monitor and change min_wal_size together with max_wal_size, wal_keep_size, wal_segment_size. 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

Tip

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

Workload Guidance
OLTP Size the recycled-segment floor from ordinary WAL generated between checkpoints and measured file-creation cost. Keep it well below available pg_wal space and evaluate it together with max_wal_size.
OLAP Large batch loads may benefit from a bigger reusable pool, but derive it from repeatable batch peaks rather than copying an arbitrary GB value; archive and slot retention are separate.
Small nodes Verify that Pigsty’s measured 5GB matrix value fits the actual disk. It is not free on a small volume; lowering it trades space for more segment create/remove churn.

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 5GB different {{ ([pg_size_twentieth, 200])|min }}GB
OLAP 5GB different {{ ([pg_size_twentieth, 200])|min }}GB
CRIT 5GB different {{ ([pg_size_twentieth, 200])|min }}GB
TINY 5GB different {{ ([pg_size_twentieth, 200])|min }}GB
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.5–19 Beta 3 = 5GB (dcs); OLAP: PG9.5–19 Beta 3 = 5GB (dcs); CRIT: PG9.5–19 Beta 3 = 5GB (dcs); TINY: PG9.5–19 Beta 3 = 5GB (dcs). Advice, pending human review — Editorial interpretation, pending human maintainer review: the override appears intended to retain a reusable WAL pool large enough to absorb routine bursts without file churn; confirm it against the current Pigsty templates, hardware fixture, and operational guarantees before publication.

Common pitfalls

  • Reading it as a maximum pg_wal size.
  • Sizing it without wal_segment_size rounding and burst rate.
  • Ignoring archive/slot retention that can exceed both min_wal_size and max_wal_size.
  • Confusing pg_settings base units with human-readable configuration units.
  • Benchmarking throughput without a crash-recovery and archive-restore test.

max_wal_size · wal_keep_size · wal_segment_size · checkpoint_timeout · checkpoint_completion_target · checkpoint_flush_after

References