Technologies/PostgreSQL/postgresql.bgwriter.sync_time
PostgreSQLPostgreSQLMetric

postgresql.bgwriter.sync_time

Checkpoint sync time
Dimensions:None
Available on:DatadogDatadog (1)Native (1)PrometheusPrometheus (1)
Interface Metrics (3)
DatadogDatadog
The total amount of checkpoint processing time spent synchronizing files to disk.
Dimensions:None
Native
Time spent syncing WAL to disk (ms)
Dimensions:None
PrometheusPrometheus
Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds
Dimensions:None

Technical Annotations (10)

Configuration Parameters (5)
checkpoint_completion_targetrecommended: 0.9
spreads checkpoint I/O over 90% of interval
checkpoint_timeoutrecommended: 15min
maximum time between checkpoints
checkpoint_warningrecommended: 30s
log warning if checkpoints occur more frequently
bgwriter_delayrecommended: 200ms
background writer wake interval to spread writes
max_wal_sizerecommended: 2-4GB for high-write workloads
WAL size threshold for checkpoint trigger
CLI Commands (1)
SELECT * FROM pg_stat_bgwriter;diagnostic
Technical References (4)
checkpointconceptbgwritercomponentpg_stat_bgwritercomponentWALcomponent
Related Insights (2)
Checkpoint spikes cause I/O contention and query latencywarning
Checkpoint frequency exceeds sustainable ratewarning

Frequent checkpoints cause I/O spikes and performance hiccups. When requested checkpoints (checkpoint_req) significantly exceed timed checkpoints (checkpoint_timed), it indicates max_wal_size is too low or write workload is too high.