TCP Keepalive: Connection Pool Exhaustion and Stale Socket Recovery
Maintaining a high-density connection pool on Linux requires a balance between resource reclamation and connection stability. When peers crash or network partitions occur without a proper FIN/RST handshake, sockets can remain in an ESTABLISHED state indefinitely, leading to pool exhaustion. The Linux kernel provides TCP Keepalive mechanisms via net.ipv4.tcp_