// postgresql · checkpoints & recovery

max_wal_size

WAL volume that triggers a checkpoint before checkpoint_timeout is reached.

Par défaut
1GB
Range
2MB to about 2PB
Restart needed
Non
Default checked on
PostgreSQL 18

Ce que cela fait

A soft limit: when this much WAL accumulates since the last checkpoint, a new one starts. Larger values mean fewer checkpoints and fewer full-page writes, at the cost of longer crash recovery and more disk for pg_wal.

Valeur par défaut

1GB. 1GB (PostgreSQL 18); initdb writes 1GB into postgresql.conf.

Check the current value

SHOW max_wal_size;

SELECT setting, unit, boot_val, context, source, pending_restart
FROM pg_settings
WHERE name = 'max_wal_size';

Change it

ALTER SYSTEM SET max_wal_size = '16GB';
SELECT pg_reload_conf();

No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).

When to change it

If the log shows 'checkpoints are occurring too frequently' or pg_stat_checkpointer (pg_stat_bgwriter before 17) shows many requested checkpoints. Busy write workloads commonly use 8-64GB.

What can go wrong

pg_wal can grow past this during bursts; make sure the volume has room. Crash recovery replays up to this much WAL.

The closest setting on other engines

MoteurParamètrePar défautRestart
PostgreSQL max_wal_size this page 1GB Non
MySQL innodb_redo_log_capacity 100MB Non
SQL Server TARGET_RECOVERY_TIME 60 SECONDS Non
Oracle fast_start_mttr_target 0 Non
SQLite wal_autocheckpoint 1000 pages Non

Questions about max_wal_size

What is the default value of max_wal_size in PostgreSQL?

1GB. 1GB (PostgreSQL 18); initdb writes 1GB into postgresql.conf.

Does changing max_wal_size require a restart?

No. No restart: reload with SELECT pg_reload_conf() or pg_ctl reload. It cannot be changed per session (context is sighup).

When should I change max_wal_size?

If the log shows 'checkpoints are occurring too frequently' or pg_stat_checkpointer (pg_stat_bgwriter before 17) shows many requested checkpoints. Busy write workloads commonly use 8-64GB.

Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.

// one client for every engine

Check max_wal_size on your own server

SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.