Cookbook recipe

WAL generation rate is unexpectedly high

Applies to PostgreSQL 13–17 Last reviewed Nov 2025 Grounded in source
Estimated investigation4 min

Scenario

The pg_wal/ directory is filling fast, replication bandwidth is saturated, or backup sizes have grown — something is generating far more WAL than expected. Diagnose it Requires PostgreSQL 14+ (pg_stat_wal was added in PG14): SELECT wal_records,…

Investigation Path

The pg_wal/ directory is filling fast, replication bandwidth is saturated, or backup sizes have grown — something is generating far more WAL than expected.

Diagnose it

Requires PostgreSQL 14+ (pg_stat_wal was added in PG14):

SELECT wal_records,
       wal_fpi,
       pg_size_pretty(wal_bytes)     AS wal_bytes,
       pg_size_pretty(wal_fpi_bytes) AS fpi_bytes,
       wal_buffers_full,
       stats_reset
FROM pg_stat_wal;

A high wal_fpi / wal_records ratio means full-page images are dominating WAL.
This happens in the pages immediately after a checkpoint. A high wal_buffers_full
counter means WAL buffers are being flushed to disk before wal_writer_delay
fires — consider increasing wal_buffers.

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:

  • Why it happens
  • 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