Networking interview question · Most asked
What do 502, 503 and 504 errors from a load balancer usually mean?
Summary
502 Bad Gateway: the load balancer got an invalid or no response from the target (connection closed, reset, crashed process). 503 Service Unavailable: no healthy targets or the service is shedding load. 504 Gateway Timeout: the target didn't respond within the load balancer's timeout.
Longer Answer
Compare load balancer error counts with the app's own 5xx: 502s without app errors point at connection handling (keep-alive timeout mismatch), 504s at slow requests or timeouts set too low, 503s at health checks or capacity. Access logs show target processing times and whether a target responded.
Key Points
- 502: bad/no response from the target.
- 503: no healthy targets or overload.
- 504: target too slow.
- Compare LB errors with app errors.
Deep dive: Cloud Networking in Production: Random 502s Behind the Load Balancer
Explanation
What interviewers look for
Mapping each code to concrete causes and to the data you'd check.
More most-asked Networking questions
- What's the difference between stateful and stateless firewalls? Give cloud examples.
- What's the difference between TCP and UDP, and when would you choose UDP?
- How does NAT work, and what are its limits?
- What is CIDR notation? How many usable addresses are in a /26, and in an AWS /26 subnet?
- How does DNS resolution work, and what does a record's TTL control?
- What does TLS provide, and how does certificate validation work?
- What happens, at the network level, when you type a URL into a browser and press Enter?
- A service is unreachable. How do you troubleshoot it systematically?