HTTP 504 Gateway Timeout
504 Gateway Timeout means a server acting as a gateway or proxy did not receive a timely response from the upstream server it needed to reach. Unlike 502 (an invalid upstream response), 504 is specifically about the upstream being too slow or unreachable. Persistent 504s degrade crawl health much like sustained 5xx errors.
What 504 means
504 Gateway Timeout is returned by a server acting as a gateway or proxy when it does not receive a response in time from an upstream server it needed to access to complete the request. The edge is reachable, but whatever sits behind it did not answer quickly enough.
Common causes are an overloaded origin, a slow database or dependency, or upstream timeout values that are too short for real workloads.
504 vs 502
502 and 504 both come from a gateway or proxy, but they describe different failures. 502 Bad Gateway means the upstream returned an invalid response. 504 Gateway Timeout means the upstream did not respond in time at all. The diagnostic path differs: 502 points at malformed responses or a crashing origin, 504 points at slowness, unreachability, or tight timeouts.
For crawlers, both are failed fetches. As with sustained 500s and 502s, persistent 504s cause crawlers to slow down and can put affected pages at risk of being treated as unavailable.
- 504 = upstream did not respond in time
- 502 = upstream returned an invalid response
- Persistent 504s degrade crawl health like sustained 5xx
Operator checklist
When crawlers see 504s, investigate origin and dependency latency, not just the edge. Review upstream timeout settings and capacity. For planned slowness or restarts, prefer returning 503 with Retry-After at the edge over letting requests time out as 504.
How it appears in analytics and logs
A 504 means a gateway or proxy timed out waiting for upstream. For crawlers it is a failed fetch; transient 504s are tolerated, but persistent 504s indicate an origin that is too slow or unreachable, which can slow crawling and risk pages being treated as unavailable.
Diagnostic use case
Diagnose 504s a crawler receives, distinguish slow-upstream timeouts from invalid-response 502s, and catch a persistent origin slowdown before it affects crawling.
What WebmasterID can help detect
WebmasterID can surface 504s crawlers receive and the affected paths, helping you tell a brief upstream slowdown from a persistent gateway timeout problem.
Common mistakes
- Confusing 504 (slow upstream) with 502 (invalid upstream response).
- Leaving upstream timeouts too short for real origin latency.
- Treating persistent 504s as harmless transient blips.
Privacy and accuracy notes
Status codes carry no personal data. WebmasterID reports 504 patterns for crawler traffic without exposing individual visitors.
Related pages
- HTTP 502 Bad Gateway
502 Bad Gateway means a server acting as a gateway or proxy received an invalid response from an upstream server it was trying to reach. It points at a problem between layers — origin down, app crash, or a misconfigured proxy — rather than at the requested resource itself.
- HTTP 503 Service Unavailable for maintenance
503 Service Unavailable means the server is temporarily unable to handle the request, usually due to maintenance or overload. It is the correct, index-protecting status for planned downtime: with a Retry-After header, compliant crawlers understand the outage is temporary and come back later.
- Website observability
See gateway timeouts crawlers receive and the affected paths.
Sources and verification notes
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.