Interview Prep/Networking/Load balancers and reverse proxies

nginx access logs suddenly show a spike of `499` status codes.

IntermediateTroubleshootingLoad balancers and reverse proxies
Answer

Likely causes → 499 is nginx-specific: the client closed the connection before nginx sent a response. Either the upstream got slow and clients (or an LB in front) gave up, or a client/load generator uses aggressive timeouts.

Diagnose →

awk '$9 == 499 {print $7}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# with $request_time in log_format, check how long the 499 requests waited

If the 499s all cluster at e.g. exactly 60 s, an LB in front has a 60 s timeout.

Fix → Fix upstream latency, or align timeouts so nginx and the app time out before the outer layer does. If you need the upstream to finish work anyway, proxy_ignore_client_abort on; (use carefully).

Prevent → Alert on 499 rate together with upstream response time; they move together.

All Networking questions Roadmap: Networking for DevOps

More on Load balancers and reverse proxies