intermittent 502 Errors under high traffic

Grace Liu 40 Reputation points
2026-10-07T01:02:26.0366667+00:00

Hello,

A high-volume service intermittently returns 502 Bad Gateway errors during peak traffic, affecting approximately 5% of requests. The issue appears to occur only when traffic increases significantly.

How can we identify whether the failures are related to connection handling, upstream availability, or timeout settings, and which configuration parameters should we review to improve stability under high load?

Windows for business | Windows Server | Performance | System performance
0 comments No comments

Answer accepted by question author
Harry Phan 36,610 Reputation points Independent Advisor
2026-10-07T02:38:44.8+00:00

Hello Grace,

A 502 Bad Gateway under peak load typically indicates that the gateway cannot obtain a valid response from the upstream service. Correlate the 502 timestamps with gateway and upstream logs to determine whether the cause is connection exhaustion, upstream failures, connection resets, or timeouts. Review the gateway’s upstream connection limits, keep-alive settings, connection timeout, response/read timeout, and maximum concurrent connections, then compare them with the upstream service’s connection and resource limits.

If connection or timeout limits are being reached, adjust them based on measured capacity rather than simply increasing timeouts, which can worsen resource pressure. Please provide the gateway/proxy product and a sample 502 log entry so we can identify the exact parameters to check.

Harry P.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.