select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / WRITE-AHEAD LOG

checkpoint_timeout

Read PG 18 manual ↗

Maximum time between automatic WAL checkpoints.

Type
integer
Context
sighup
Measured default
5 min
Unit
s
Metadata snapshot
18

Definition PG 18 manual

Maximum time between automatic WAL checkpoints. If this value is specified without units, it is taken as seconds. The valid range is between 30 seconds and one day. The default is five minutes (5min). Increasing this parameter can increase the amount of time needed for crash recovery. This parameter can only be set in the postgresql.conf file or on the server command line.

Measured default history
Version intervalDefault
9.0 – 195 min
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

An automatic checkpoint is considered after checkpoint_timeout, but max_wal_size can force one earlier. If no WAL has been written since the preceding checkpoint, PostgreSQL can skip the timed checkpoint, so this setting is a maximum scheduling interval rather than a promise of periodic physical work.

Longer intervals usually reduce checkpoint frequency and full-page-write amplification, while increasing the amount of WAL that crash recovery may need to replay. Shorter intervals bound that replay horizon more tightly but increase dirty-page flushing and post-checkpoint full-page images.

Checkpoint records also constrain restartpoints on standbys. This parameter should not be used to set a WAL-archive recovery point objective; archive_timeout is the control intended to force segment switches for low-WAL systems.

Operational considerations

Assuming a checkpoint occurs exactly every configured interval even on an idle system.

Forgetting that max_wal_size can trigger a checkpoint earlier.

Using checkpoint_timeout instead of archive_timeout to bound archive delay.

Increasing it without allowing for a longer crash-recovery replay horizon.

Reducing it so far that full-page writes and checkpoint I/O dominate.

Workload guidance

OLAP: During bulk work, max_wal_size often triggers before the timer. Increase WAL capacity first if volume-driven checkpoints dominate, and retain a timeout that still meets restart and recovery expectations.

OLTP: Tune it together with max_wal_size and keep checkpoint I/O spread with checkpoint_completion_target. Extend the interval only after measuring recovery requirements, requested versus timed checkpoints, write latency, and WAL volume.

SMALL: The upstream 5-minute default is a defensible starting point where recovery time matters and storage is limited. A longer interval needs explicit disk headroom and a tested crash-recovery budget.

Version history 3
  1. PG 11 → 12changed
  2. PG 9.5 → 9.6changed
  3. PG 9.4 → 9.5changed

Related entries

Further reading

Definition snapshot: english-manuals:4c0256b782d0bb7d6b3037d5cad… · English manual source