Protocols
Saved & recent

TCP keepalive

Also called: TCP keep-alive, keepalive probe, idle connection probe

TCP keepalive is an optional mechanism for probing an idle connection to see whether the remote TCP endpoint still responds. After a configured idle interval, the local stack sends a probe designed to elicit a reply. Applications can enable or disable the mechanism, and timing policies vary across implementations and deployments.

For example, a database client may use keepalive to eventually detect a peer that disappeared while no queries were being sent. One unanswered probe alone does not establish a dead connection. Conversely, a reply only demonstrates a responsive TCP endpoint: the database application might still be stuck. TCP keepalive is distinct from an application heartbeat and from HTTP connection reuse sometimes called keep-alive.

Read first
TCP
Related
Heartbeat and keepalive, Timeout, HTTP/1.1
Further reading
IETF RFC 9293 — Transmission Control Protocol (TCP)
server application stalled client TCP stack server TCP stack idle interval keepalive probe TCP ACK optional · configurable
Illustrative limit of TCP keepalive: a responding network stack can coexist with an application that is unable to serve requests.

View in the full Protocols collection