{"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)"}],"derived_content_hash":"2f6f824beb7b593b121aedde46cfdd3d8190c6bbc507c9d97567eb8617ae3fa8","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"],"repair_provenance":{"original_source_revision":"english-manuals:9be7df02ae9b86756db021f8a82d459bb56d00444f9ea25c3e0100ccdc02419c","receipt_sha256":"5cff2776d50adc82f5bbf3e85155a5b69e9f141559df3684b8b5d404b35de605","repair":"wiki-repair-20261023"},"short_desc":"Specifies how often the WAL writer flushes WAL, in volume terms.","short_desc_zh":"","source_rev":"wiki-repair-20261023:0e1b8498267b93f2d99ff9351c66fcddbce5231c46d31ffc53a8b1a769113dd5","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"wal_writer_flush_after","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"wal_writer_flush_after","SourceRevision":"wiki-repair-20261023:0e1b8498267b93f2d99ff9351c66fcddbce5231c46d31ffc53a8b1a769113dd5","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.","description_zh":"指定 WAL 写入器刷写 WAL 的频繁程度，按数据量衡量。如果距上次刷盘的时间小于 wal_writer_delay，并且自那以后产生的 WAL 数据量小于 wal_writer_flush_after，则只将 WAL 写入操作系统，而不刷写到磁盘。如果 wal_writer_flush_after 被设置为 0，则 WAL 数据总是会被立即刷写。如果指定值时没有单位，则以 WAL 块作为单位，即为 XLOG_BLCKSZ 字节，通常为 8kB。默认是 1MB。这个参数只能在 postgresql.conf 文件中或者服务器命令行上设置。","description_zh_html":"\u003cp\u003e\n        指定 WAL 写入器刷写 WAL 的频繁程度，按数据量衡量。如果距上次刷盘的时间小于 \u003ccode class=\"varname\"\u003ewal_writer_delay\u003c/code\u003e，并且自那以后产生的 WAL 数据量小于 \u003ccode class=\"varname\"\u003ewal_writer_flush_after\u003c/code\u003e，则只将 WAL 写入操作系统，而不刷写到磁盘。如果 \u003ccode class=\"varname\"\u003ewal_writer_flush_after\u003c/code\u003e 被设置为 \u003ccode class=\"literal\"\u003e0\u003c/code\u003e，则 WAL 数据总是会被立即刷写。如果指定值时没有单位，则以 WAL 块作为单位，即为 \u003ccode class=\"symbol\"\u003eXLOG_BLCKSZ\u003c/code\u003e 字节，通常为 8kB。默认是 \u003ccode class=\"literal\"\u003e1MB\u003c/code\u003e。这个参数只能在 \u003ccode class=\"filename\"\u003epostgresql.conf\u003c/code\u003e 文件中或者服务器命令行上设置。\n       \u003c/p\u003e","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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-wal.html","sha256":"94cdacb1171b4c528492ca0aec6aafa48a2c758276225fe0dbfe5b12452d4930"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":"8kB","vartype":"integer","zh_from":"same-version-pgdoc"},"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":"wiki-repair-20261023:0e1b8498267b93f2d99ff9351c66fcddbce5231c46d31ffc53a8b1a769113dd5","ContentHash":"47249963d3a961e6660ae81e019d125037f82fc64402495ffdbd350091443a69","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":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
