Networking interview question · Most asked

What do 502, 503 and 504 errors from a load balancer usually mean?

Create a free account to save this page, take notes and track your progress. Sign in

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

← All Networking questions

Was this page helpful?