September 28, 2026 · 6 min read
What TCP keepalive actually does
Keepalive probes are sent by the kernel after a connection has been idle for tcp_keepalive_time seconds — two hours by default. They tell you whether the peer is still reachable, not whether the application on the other side is healthy.
If you need to know that the application is alive, send something the application has to answer. If you only want NAT tables and load balancers to remember your connection, lower the idle time per socket rather than system-wide.