Interview Prep/Networking/Load balancers and reverse proxies

After scaling a backend from 3 to 6 instances, the 3 new instances get almost no traffic.

IntermediateTroubleshootingLoad balancers and reverse proxies
Answer

Likely causes → Clients (or an upstream proxy) hold long-lived keep-alive or HTTP/2/gRPC connections to the original instances. An L4 LB balances connections, not requests, so existing connections never move. Least-outstanding-requests or slow start can also skew early traffic.

Diagnose →

# per-target connection counts
aws cloudwatch get-metric-statistics --namespace AWS/ApplicationELB --metric-name RequestCountPerTarget ...
ss -tn state established '( sport = :8080 )' | wc -l    # on old vs new instances

Fix → Use an L7 balancer that balances per request (ALB, Envoy, nginx with upstream keepalive pool). For gRPC, use client-side balancing or a proxy that understands HTTP/2 streams, and set max_connection_age on servers so clients reconnect periodically.

Prevent → Cap connection lifetime on servers and verify traffic distribution after every scale event.

All Networking questions Roadmap: Networking for DevOps

More on Load balancers and reverse proxies