Cookbook recipe

Size WAL: max_wal_size, min_wal_size, checkpoint_timeout

Applies to PostgreSQL 13–17 Last reviewed May 2026 Grounded in source
Estimated investigation4 min

Scenario

WAL volume swings wildly and checkpoints fire unpredictably. Right-sizing the WAL settings stabilizes both. Diagnose it Observe checkpoint cause and WAL generation: SELECT checkpoints_timed, checkpoints_req FROM pg_stat_bgwriter; Why it happens WAL accumulates until a checkpoint frees…

Investigation Path

WAL volume swings wildly and checkpoints fire unpredictably. Right-sizing the WAL settings stabilizes both.

Diagnose it

Observe checkpoint cause and WAL generation:

SELECT checkpoints_timed, checkpoints_req FROM pg_stat_bgwriter;

Why it happens

WAL accumulates until a checkpoint frees it. If max_wal_size is too small for the write rate, checkpoints are forced early (checkpoints_req high). min_wal_size keeps recycled segments around to avoid churn.

This is a Pro lesson

Get every Learning Pathway and cookbook recipe — grounded in PostgreSQL source code, with diagnostics, fixes, and prevention for each topic.

Continue this lesson to learn:

  • How to fix it
  • Prevent it next time
  • Related & next steps
  • All 36 Learning Pathway lessons
  • 170+ cookbook recipes
  • Source-grounded diagnostics & fixes

Secure checkout Cancel anytime Source-grounded

Career Impact

This scenario builds production judgment and operational confidence under pressure.

Open Career Dashboard →

Keep going

Related & next steps

Was this helpful?

← All cookbook recipes