max_wal_size gives PostgreSQL's transaction log a size budget. Some write-heavy servers outgrow the 1 GB default - and when that happens, PostgreSQL is forced to write the same data to disk again and again. We explain what the setting really does, how to reduce that wasted disk work using your server's own counters, and when to leave it alone.
The setting that is easy to overlook
Every busy PostgreSQL server writes more to disk than the application asks it to. Some of that extra work is normal and healthy. But on write-heavy systems, part of it can be repeated, avoidable work - and how much of that happens is heavily influenced by one setting: max_wal_size . Nothing in daily operation points at it, and the advice that is easy to find online is generic - a fixed number, or a calculator that cannot see your workload.…