Timeout waits
Timeout usually means PostgreSQL intentionally delayed work until a timer expires. The important question is not “why is the kernel slow?” but “which policy or safety mechanism inserted this delay?”
Identify the policy owner
Vacuum cost delay, recovery delay, backup throttling, checkpoint spreading, retry intervals, and pg_sleep() are designed waits. They become a problem when the policy no longer matches the service objective or when another bottleneck makes the delay recur excessively.
- Normal: the configured policy is active and useful work advances at the expected rate.
- Watch: foreground latency includes a deliberate sleep, or maintenance falls behind while spending much of its time throttled.
- Urgent: recovery/backup/checkpoint deadlines are missed, a spin delay persists, or an operator did not intend the policy.
Events to recognize
| Event | Policy |
|---|---|
| VacuumDelay | Cost-based vacuum throttling |
| CheckpointWriteDelay | Spreading checkpoint writes across the interval |
| RecoveryApplyDelay | Intentional delayed standby replay |
| RecoveryRetrieveRetryInterval | Retrying unavailable WAL sources |
| BaseBackupThrottle | Backup transfer-rate limit |
| PgSleep | SQL or internal sleep function |
| SpinDelay | Backoff while acquiring a contended spinlock |
Common misreads
Timeoutdoes not mean a statement or lock timeout fired; it means the process is currently sleeping on a timer.- Reducing vacuum delay can recover maintenance throughput but also increase I/O and CPU pressure.
RecoveryApplyDelaycan be intentional disaster-recovery policy.- Persistent
SpinDelaydeserves escalation: a spinlock should normally be held for an extremely short time.
Waiting during base backup when throttling activity
Waiting between writes while performing a checkpoint
Waiting due to a call to pg_sleep or a sibling function
Waiting to apply WAL during recovery because of a delay setting
Waiting during recovery when WAL data is not available from any source (pg_wal, archive or stream)
Waiting while sending synchronization requests to the checkpointer, because the request queue is full
Waiting while acquiring a contended spinlock
Waiting in a cost-based vacuum delay point
Waiting to acquire an exclusive lock to truncate off any empty pages at the end of a table vacuumed
Waiting after a WAL summarizer error