{"Entry":{"collection":"guc","key":"wal_writer_flush_after","name":"wal_writer_flush_after","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Write-Ahead Log / Settings","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"9.5","status":"added","to":"9.6"},{"documentation_changed":true,"fields":{},"from":"11","status":"changed","to":"12"}],"content_hash":"ad528e4235e5cf588ad964214972b604946ff291cc9764cfe1344746e4b99288","context":"","default_changed_in":[],"default_history":[{"from":"9.6","to":"19","value":"1 MiB (128 × 8kB)"}],"editorial":{"advice":{"olap":"Provision WAL, archive bandwidth, and recovery I/O for bulk-load peaks. Coordinate load pacing and checkpoints when reducing spikes; never break the recovery chain for throughput.","oltp":"Establish durability and recovery objectives first, then tune wal_writer_flush_after from WAL rate, flush latency, checkpoints, and peak pg_wal usage. Validate every change with crash/recovery and archive monitoring.","small":"Start from safe defaults and set explicit alerts for limited disk capacity. Do not disable durability or break the recovery chain merely to save modest I/O."},"mechanism":["Amount of WAL written out by WAL writer that triggers a flush. A configuration reload applies a new value; existing work already in flight is not retroactively changed.","After this volume since its last flush, the WAL writer forces written WAL to durable storage; otherwise it may only write to the OS. Zero flushes immediately, while larger values trade background smoothing against a bigger dirty-WAL window for asynchronous commits.","Monitor and change wal_writer_flush_after together with wal_buffers, wal_writer_delay, wal_sync_method. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Reading an unqualified value as bytes rather than WAL blocks.","Forgetting that zero requests an immediate flush from the WAL writer.","Choosing a large batch without considering asynchronous-commit loss exposure and dirty WAL.","Treating the setting as a replacement for synchronous commit flushes.","Tuning it without wal_writer_delay and storage flush latency."],"references":[{"title":"PostgreSQL 19 Beta 4: wal_writer_flush_after","url":"https://www.postgresql.org/docs/19/runtime-config-wal.html#GUC-WAL-WRITER-FLUSH-AFTER"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["wal_buffers","wal_writer_delay","wal_sync_method","synchronous_commit","commit_delay","commit_siblings"],"summary":"wal_writer_flush_after — Amount of WAL written out by WAL writer that triggers a flush. Observed in PG9.6–19 Beta 4; its last measured boot default is 1 MiB (128 × 8kB) in PG19 Beta 4, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"9.6","group":"Write-Ahead Log","group_slug":"wal","imported_at":"2026-09-27T17:57:32.38677+08:00","intro_commit":{"authored_at":"2016-02-15T23:52:38+01:00","discussion":[],"hash":"7975c5e0a992ae9a45e03d145e0d37e2b5a707f5","subject":"Allow the WAL writer to flush WAL at a reduced rate.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7975c5e0a992ae9a45e03d145e0d37e2b5a707f5"},"key":"wal_writer_flush_after","last_version":"20","max_val":"","min_val":"","name":"wal_writer_flush_after","position":486,"present_in":["9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Specifies how often the WAL writer flushes WAL, in volume terms.","short_desc_zh":"","source_rev":"english-manuals:9be7df02ae9b86756db021f8a82d459bb56d00444f9ea25c3e0100ccdc02419c","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"wal_writer_flush_after","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"wal_writer_flush_after","SourceRevision":"english-manuals:9be7df02ae9b86756db021f8a82d459bb56d00444f9ea25c3e0100ccdc02419c","Facts":{"boot_val":"128","category":"Write-Ahead Log / Settings","context":"sighup","description":"Specifies how often the WAL writer flushes WAL, in volume terms. If the last flush happened less than wal_writer_delay ago and less than wal_writer_flush_after worth of WAL has been produced since, then WAL is only written to the operating system, not flushed to disk. If wal_writer_flush_after is set to 0 then WAL data is always flushed immediately. If this value is specified without units, it is taken as WAL blocks, that is XLOG_BLCKSZ bytes, typically 8kB. The default is 1MB. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-WAL-WRITER-FLUSH-AFTER","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"wal_writer_flush_after","short_desc":"Amount of WAL written out by WAL writer that triggers a flush.","source":"pg-settings-source-snapshot","unit":"8kB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-WAL-WRITER-FLUSH-AFTER","file":"runtime-config-wal.html","lang":"en","sha256":"d2646404a06e8f7ac655204b4f28c049ae8f3fd4f2272db080fcefa2c4af0763","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"wal_writer_flush_after","SourceDatabase":"center","Version":"18","Locale":"en","Title":"wal_writer_flush_after","Summary":"Specifies how often the WAL writer flushes WAL, in volume terms. If the last flush happened less than wal_writer_delay ago and less than wal_writer_flush_after worth of WAL has been produced since, then WAL is only written to the operating system, not flushed to disk. If wal_writer_flush_after is set to 0 then WAL data is always flushed immediately. If this value is specified without units, it is taken as WAL blocks, that is XLOG_BLCKSZ bytes, typically 8kB. The default is 1MB. This parameter can only be set in the postgresql.conf file or on the server command line.","BodyHTML":"\u003cp\u003eSpecifies how often the WAL writer flushes WAL, in volume terms. If the last flush happened less than wal_writer_delay ago and less than wal_writer_flush_after worth of WAL has been produced since, then WAL is only written to the operating system, not flushed to disk. If wal_writer_flush_after is set to 0 then WAL data is always flushed immediately. If this value is specified without units, it is taken as WAL blocks, that is XLOG_BLCKSZ bytes, typically 8kB. The default is 1MB. This parameter can only be set in the postgresql.conf file or on the server command line.\u003c/p\u003e","SourceRevision":"english-manuals:9be7df02ae9b86756db021f8a82d459bb56d00444f9ea25c3e0100ccdc02419c","ContentHash":"55ad4da1f01072c5cb0be9cab7ff7c2429ad469a76b8b866cc39f0ff57ee6565","Payload":{"description":"Specifies how often the WAL writer flushes WAL, in volume terms. If the last flush happened less than wal_writer_delay ago and less than wal_writer_flush_after worth of WAL has been produced since, then WAL is only written to the operating system, not flushed to disk. If wal_writer_flush_after is set to 0 then WAL data is always flushed immediately. If this value is specified without units, it is taken as WAL blocks, that is XLOG_BLCKSZ bytes, typically 8kB. The default is 1MB. This parameter can only be set in the postgresql.conf file or on the server command line."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.6"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
