Idle time before TCP keepalive probes start.
At a glance
| Property | Value |
|---|---|
| Parameter | tcp_keepalives_idle |
| Category | Connections |
| Default | 0 |
| Value type | time (ms/s/min) |
| Change scope | Per-session (SET) |
What it does
Seconds of idle time before the OS sends a TCP keepalive probe on a client connection. 0 uses the system default.
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW tcp_keepalives_idle; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'tcp_keepalives_idle';.
Tuning guidance
Set to ~60s when clients sit behind NAT/firewalls that silently drop idle connections, so dead peers are detected instead of hanging.