Skip to content

checkpoint_flush_after

checkpoint_flush_after — Number of pages after which previously performed writes are flushed to disk. Observed in PG9.6–19 Beta 3; its last measured boot default is 256 KiB (32 × 8kB) in PG19 Beta 3, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
Note

Fact — official short description: “Number of pages after which previously performed writes are flushed to disk.”

Identity

Type , Valueinteger
Upstream pg_settings type
Context , Valuesighup
Takes effect after configuration reload
Unit , Value8kB
Raw unit
Range , Value0256
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueWrite-Ahead Log / Checkpoints
Upstream classification
Latest boot value , Value32
256 KiB (32 × 8kB)

Lifecycle

Fact Value
First observed PG9.6
Present in PG9.6–19 Beta 3
Removed in No
Introduction commit 428b1d6b29ca — Allow to trigger kernel writeback after a configurable number of writes.
Commit date 2016-02-19
Discussion

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.6–19 Beta 3 32 8kB 256 KiB (32 × 8kB)

How it works

Number of pages after which previously performed writes are flushed to disk. A configuration reload applies a new value; existing work already in flight is not retroactively changed.

Checkpoint writes are periodically handed to the operating system for writeback after this much data, smoothing the final sync and reducing dirty-cache bursts. Zero disables these intermediate flush requests; the best value is operating-system and storage dependent.

Monitor and change checkpoint_flush_after together with checkpoint_warning, checkpoint_timeout, checkpoint_completion_target. 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.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Establish durability and recovery objectives first, then tune checkpoint_flush_after from WAL rate, flush latency, checkpoints, and peak pg_wal usage. Validate every change with crash/recovery and archive monitoring.
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.
Small nodes Start from safe defaults or the measured Pigsty value and set explicit alerts for limited disk capacity. Do not disable durability or break the recovery chain merely to save modest I/O.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP Unmodified
OLAP Unmodified
CRIT Unmodified
TINY Unmodified
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.6–19 Beta 3 unmodified; OLAP: PG9.6–19 Beta 3 unmodified; CRIT: PG9.6–19 Beta 3 unmodified; TINY: PG9.6–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

Common pitfalls

  • Treating the raw value as bytes even though an unqualified value is measured in database blocks.
  • Setting it too small and increasing writeback calls and I/O fragmentation.
  • Setting it too large and losing the intended smoothing before the checkpoint sync phase.
  • Confusing writeback hints with a durability guarantee; fsync and wal_sync_method still define persistence.
  • Copying a value across operating systems or filesystems without measuring checkpoint latency and dirty-page behavior.

checkpoint_warning · checkpoint_timeout · checkpoint_completion_target · max_wal_size · min_wal_size · archive_cleanup_command

References