Interview Prep/Networking/Performance, Cost & Scale

How do you tune TCP keepalives and idle timeouts across layers?

IntermediateProductionPerformance, Cost & Scale
Answer

Know each layer's idle timeout: NAT gateway 350s, NLB TCP 350s, ALB 60s default, Azure LB 4 min, many corporate firewalls 1 hour or less. Application keepalives should send before the shortest timeout.

sysctl -w net.ipv4.tcp_keepalive_time=240 net.ipv4.tcp_keepalive_intvl=30 net.ipv4.tcp_keepalive_probes=5

Silent drops of idle database connections after 350 seconds are a classic NAT-gateway symptom.

All Networking questions Roadmap: Networking for DevOps

More on Performance, Cost & Scale