Skip to content

checkpoint: checkpoints, bgwriter, and buffer writes

Inspect the last checkpoint/restartpoint, cumulative bgwriter/backend buffer writes, average rates, and checkpoint GUCs.

Reads sys_control_checkpoint(), sys_stat_bgwriter, and checkpoint GUCs (checkpoint_timeout, max_wal_size, checkpoint_completion_target, checkpoint_warning, log_checkpoints). Read-only: never runs CHECKPOINT.

Counters accumulate since stats_reset; on standbys, checkpoints_timed counts restartpoint attempts (one try every 15s when no new checkpoint record arrives) and does not compare directly with primary counts.

Usage

kbdiag checkpoint
kbdiag checkpoint --json

Key Options

OptionEffect
--jsonEmit structured JSON (checkpoint.last, checkpoint.stats, checkpoint.settings)

Verdict & Reading Output

  • OK (exit=0): All three probes succeeded (informational metrics — cumulative counters are shown, never turned into synthetic alarms).
  • UNKNOWN (exit=3): Any checkpoint probe failed, timed out, or lacked permission.
  • [NEXT] hints: Guides to kbdiag wal when checkpoints_req > checkpoints_timed or buffers_backend_fsync > 0, and notes log_checkpoints = on when disabled.

Example (KES V9 Primary, COLUMNS=80)

checkpoint  OK  (primary, system@local, endpoint=/tmp/.s.KINGBASE.54321,
    2026-12-02T16:12:53Z)
[LAST CHECKPOINT]
  time  2026-12-02T16:04:29Z  (8m 25s ago)
  redo  10/400FB450  (000000010000001000000040)
[STATISTICS]
  stats_reset=2026-11-29T09:11:20Z (3d 7h ago)
  checkpoints           673: 673 timed, 0 requested (0%; requested covers WAL
    volume, CHECKPOINT, base backups, promotion)
  write, sync time      3m 57s, 704 ms
  buffers written       12929: checkpointer 2226 (17%), bgwriter 0 (0%),
    backends and others 10703 (83%)
  buffers allocated     9927
  backend fsyncs        0
  bgwriter stopped      0 times at bgwriter_lru_maxpages
  window average rates  0.002 checkpoints/s; 0.002 timed/s; 0.000 requested/s
  buffer rates          0.05 blocks/s written (checkpoint 0.01, bgwriter 0.00,
    backend 0.04); 0.03 blocks/s allocated
[SETTINGS]
  checkpoint_timeout            5m 0s
  max_wal_size                  1024 MB
  checkpoint_completion_target  0.5
  checkpoint_warning            30s
  log_checkpoints               off
[NEXT]
  SHOW log_checkpoints  # consider enabling log_checkpoints = on for timing and
    write/sync logs
  • kbdiag wal — inspect WAL footprint, max_wal_size, slots, and archiver retention
  • kbdiag wal (wal archive) — check archiver success/failure and .ready queue
  • kbdiag progress — inspect an in-progress CHECKPOINT