How do you handle long-lived connections (WebSockets, SSE, gRPC streams) during deploys?
AdvancedProductionLoad Balancing, Proxies & nginx in Production
Answer
Increase idle timeouts, send heartbeat pings so intermediaries do not drop idle flows, drain gracefully by sending a close frame or GOAWAY and letting clients reconnect with jitter to avoid a thundering herd, and use deregistration delay longer than typical session length where tolerable.
Plan capacity for reconnect storms; a deploy that disconnects 200,000 clients at once is an incident.
More on Load Balancing, Proxies & nginx in Production
How do you choose between ALB, NLB and an nginx or Envoy fleet?IntermediateHow do you tune ALB idle timeout and backend keep-alive to avoid 502s?IntermediateWhich nginx directives matter most for a production reverse proxy?IntermediateHow do you do rate limiting and abuse protection in nginx?IntermediateHow do you achieve zero-downtime configuration reloads in nginx and HAProxy?IntermediateHow would you design a highly available load-balancing tier on-prem or in a colo?Advanced