min_wal_size
WAL kept as recycled segments instead of being removed after a checkpoint.
- Default
80MB- Range
- 2MB to about 2PB
- Restart needed
- No
- Default checked on
- PostgreSQL 18
What it does
Below this size, old WAL files are renamed for reuse rather than deleted, which absorbs write bursts without creating new files.
Default value
80MB. 80MB (PostgreSQL 18).
Check the current value
SHOW min_wal_size; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'min_wal_size';
Change it
ALTER SYSTEM SET min_wal_size = '2GB'; 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
Raise it on servers with periodic write spikes, such as batch loads.
What can go wrong
Uses that much disk in pg_wal permanently.
Questions about min_wal_size
What is the default value of min_wal_size in PostgreSQL?
80MB. 80MB (PostgreSQL 18).
Does changing min_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 min_wal_size?
Raise it on servers with periodic write spikes, such as batch loads.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check min_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.