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.