504 Gateway Timeout

What a 504 Gateway Timeout means, how slow upstream servers trigger it, how Googlebot treats timeouts, and the crawl-budget and indexing consequences.

First published: Jun 28, 2026 · Last updated: Jul 17, 2026 · Advanced
demand #3 in HTTP Errors#3 in HTTP Status Codes#12 in Technical SEO#18 on the site
1 evidence signal on this page

A 504 Gateway Timeout means a gateway or proxy (CDN, load balancer, reverse proxy) didn't get a timely response from the upstream server behind it. It's a timeout — different from a 502 (bad response) or a 503 (explicitly unavailable). It's not a Google penalty; it's an accessibility problem. Isolated 504s get retried, but sustained timeouts sit alongside 429/500/503 as the errors that make Googlebot back off and, if they persist, drop pages from the index. Identify which hop actually timed out before you fix anything — server response time (TTFB) is a strong preventive lever for slow origins, but raising the timeout value isn't a fix either way.

TL;DR — A 504 is a gateway/proxy telling you the upstream server didn’t respond within the timeout window — a timeout, distinct from a 502 (bad response) or a 503503 Service Unavailable is the HTTP status code a server returns when it's temporarily unable to handle a request — usually because of overload or planned maintenance. It tells crawlers 'come back later' instead of 'this page is gone,' which is why Google recommends it (paired with a Retry-After header) for short, planned downtime. (explicit unavailability). It’s an accessibilityWeb accessibility means designing sites so people with disabilities can use them, per the W3C's WCAG guidelines. It overlaps with SEO in specific, checkable ways — alt text, heading structure, descriptive link text, captions, and page speed all serve both audiences — but Google has said accessibility itself is not a ranking factor, and most WCAG success criteria (keyboard focus order, ARIA live regions, form labels) have no SEO effect at all. problem, not a penalty. Timeouts sit in the same bucket as 429429 Too Many Requests is an HTTP client-error status code that means a client sent too many requests in a given time window — a mechanism called rate limiting. Unlike other 4xx codes, Google treats 429 as a server-overload signal and slows crawling instead of removing content./500/503: GooglebotGooglebot is Google's web crawler — the software that fetches pages so Google can index and rank them. It comes in two variants, Googlebot Smartphone (primary, under mobile-first indexing) and Googlebot Desktop, and runs an evergreen Chromium renderer. backs off when it sees them, and sustained 504s risk deindexingDeindexing means getting a URL to stop appearing in Google's search results. There's no single delete button — the right method depends on whether you own the page, whether removal is temporary or permanent, and whether the content should still exist.. The durable fix is server response time (TTFBTime to First Byte — the time from the start of a request to when the first byte of the response arrives. It's a diagnostic metric (not a Core Web Vital) and a major input to FCP and LCP; ≤0.8 s is good.), not a longer timeout value — raising the timeout usually masks a slow upstream and can make things worse under load.

Where a 504 originates in the request chain

A modern request path looks roughly like: browser → CDN/edge → load balancer → reverse proxy (e.g. Nginx) → app server (PHP-FPM, Node, etc.) → database / third-party APIs. A 504 is generated by whichever component was waiting on the one behind it when its timeout expired. That’s the first diagnostic question: Evidence for this claim A 504 response means a gateway or proxy did not receive a timely response from an upstream server. Scope: RFC 9110 defines the timeout semantics; it does not determine why the upstream response was delayed. Confidence: high · Verified: IETF: RFC 9110 §15.6.5 — 504 Gateway Timeout

  • CDN/edge timing out on origin → the fix is origin performance, or raising the CDN’s upstream timeout (carefully — see below).
  • Load balancer timing out on the app server → check app-server health and autoscaling.
  • Reverse proxy timing out on the app process → look at Nginx’s proxy_read_timeout / fastcgi_read_timeout and the slow query or process that’s actually behind it.

Getting the layer right matters, because “fix the timeout at the edge” and “fix the slow database query at the origin” are completely different jobs.

What causes 504s

The status code itself doesn’t prove a cause — it only tells you a gateway timed out waiting on an upstream. These are the usual suspects worth checking, not facts the 504 already established; confirm with logs and traces before you act on one:

  • Slow database queries or upstream API calls. A single unindexed query or a laggy third-party dependency can push response time past the timeout.
  • Server/app overload and resource exhaustion. Under enough concurrent load, requests queue, worker processes fill up, and responses stop arriving in time.
  • Misconfigured timeout values across Nginx, Apache, the load balancer, or the CDN — often mismatched between layers so one gives up before another.
  • Traffic spikes, botA crawler — also called a spider or bot — is an automated program that fetches web pages, extracts their links, and queues new URLs to visit. Search engines use crawlers to discover and download content for their index. floods, or DDoS that overwhelm capacity temporarily.

504s are often intermittent and load-dependent

This is what makes them nasty. Unlike a hard outage, a 504 frequently appears only under load — which means an uptime monitor pinging during a quiet window can show 100% green while GooglebotGooglebot is Google's web crawler — the software that fetches pages so Google can index and rank them. It comes in two variants, Googlebot Smartphone (primary, under mobile-first indexing) and Googlebot Desktop, and runs an evergreen Chromium renderer., crawlingCrawling is how search engines use automated bots (like Googlebot and Bingbot) to discover URLs and download pages. A page has to be crawlable to be indexed, but crawling on its own isn't a ranking factor. in heavier bursts, is quietly collecting timeouts. In Google Search ConsoleA free Google service that reports how a site performs in Google Search and surfaces problems with how Google crawls, indexes, and serves it. It's first-party data straight from Google — but you don't need it to appear in results.’s URL Inspection you may see this surface as a “Hostload exceeded” condition rather than a clean, constant error. If your monitoring says everything’s fine but Crawl Stats disagrees, load-dependent 504s are a prime suspect.

How Googlebot (and Bingbot) handle timeouts

Google doesn’t treat a 504 as a content-quality judgment — it’s an availability signal, and the response is automatic throttling. Its crawlingCrawling is how search engines use automated bots (like Googlebot and Bingbot) to discover URLs and download pages. A page has to be crawlable to be indexed, but crawling on its own isn't a ranking factor. docs are explicit: “Googlebot will scale back its crawling if it detects that your servers are having trouble responding to crawl requests.” The large-site crawl-budget guide says the same thing in budget terms: “If the site slows down or responds with server errors, the limit goes down and Google crawls less.” Evidence for this claim Google reduces crawling when server errors or slow responses indicate a site is having trouble responding. Scope: Google's documentation supports automatic crawl throttling for server trouble; it does not attribute a specific 504 to any particular bottleneck. Confidence: high · Verified: Google: Troubleshoot crawling errors

The freshest framing tying this straight to slow/timing-out responses comes from Google’s March 2026 Inside Googlebot explainer, where Gary Illyes is quoted saying: “If your server is struggling to serve bytes, our crawlersA crawler — also called a spider or bot — is an automated program that fetches web pages, extracts their links, and queues new URLs to visit. Search engines use crawlers to discover and download content for their index. will automatically back off to avoid overloading your infrastructure, which will drop your crawl frequencyCrawl frequency is how often a search engine comes back to re-fetch a page it already knows about. Popular pages that change often get refreshed many times a day; stable pages can go weeks or months between crawls — and you influence it indirectly, not by setting a dial..” (As reported by Search Engine Land’s coverage — worth confirming against the original recording or transcript if you’re citing it elsewhere.) A 504 is that struggle made visible.

One nuance worth understanding: Google doesn’t always see a literal “504” the way your browser does. If the timeout happens before Googlebot gets any status line at all, it’s logged as a timeout/network error in Crawl Stats rather than a clean 5XX. But when an intermediary proxy or CDN times out and generates its own 504 response, Googlebot receives a standard 5XX server error. Either way the effect is identical: throttled crawl rateCrawl rate is how fast a search engine crawler fetches pages from your site — the number of simultaneous requests it makes and the delay between them. Google sets it automatically based on your server's health; it's the supply side of crawl budget, not a ranking factor., and, if sustained, removal from the index.

Bing documents timeouts as their own crawl-error category, separate from server errors — BingbotBingbot is Microsoft Bing's primary web crawler — the bot that discovers, fetches, and renders pages to build the Bing index. That index also powers Yahoo, DuckDuckGo, Ecosia, and Microsoft Copilot, so Bingbot's reach is far wider than Bing's own search-market share. stops trying to access pages when responses are too slow — and its standing recommendation is to check server response time, keep server software updated, optimize slow resources, and read server logs for systemic patterns rather than one-off blips. Bing hasn’t published the same level of throttle-and-recover detail Google has, so treat the two as broadly comparable in intent rather than confirmed to behave identically.

The throttle-then-recover feedback loop

The reassuring part: this loop is automatic and self-correcting. Google throttles down when it sees errors and timeouts, then ramps crawling back up gradually once responses are healthy again. There’s no manual “unthrottle” button you need to press once the underlying issue is fixed — as John Mueller noted, “Once things settle down on the server, the crawl rate will return to normal automatically.” He also flagged the asymmetry: throttling down happens fast to resolve an immediate problem; ramping back up is done cautiously.

Duration is what converts a blip into an indexing problem

Short, occasional 504s — a few during a spike, resolved quickly — get retried and are largely tolerated. What risks deindexingDeindexing means getting a URL to stop appearing in Google's search results. There's no single delete button — the right method depends on whether you own the page, whether removal is temporary or permanent, and whether the content should still exist. is a sustained pattern of timeouts over an extended window. Google’s documented “come back later” mechanics — where you intentionally return 503 or 429 during overload — describe roughly a two-day horizon before URLs start dropping, but that specific number is documented for 503/429 by name, not for 504. Google’s broader 5xx guidance says crawl rate drops proportionally to how many URLs are erroring and recovers gradually once responses are healthy, without naming a fixed horizon for 504 specifically. Extending the two-day figure to 504 is a reasonable inference, not a documented fact — treat it as: brief 504s are survivable, and a sustained pattern over days is the range where you should worry, not a guaranteed trigger date.

Why this matters more on large and ecommerce sites

If you have a small site whose pages get crawled the same day they publish, you’ll almost never notice this. But on large or fast-changing sites — big ecommerce catalogs, news, marketplaces — crawl budgetThe number of URLs an engine will crawl in a timeframe. is already the constraint, and a wave of 504s during peak load can starve crawling of pages that genuinely need to be recrawled. Timeouts and crawl budget are the same conversation at scale.

Server response time and TTFB are a strong preventive lever — for origin-side causes

Here’s a point most 504 articles miss: waiting until errors appear and then log-grepping is reactive. Monitoring server response time continuously, so you see the drift before it tips into a timeout, is proactive. A server that’s slow but not yet timing out today becomes a 504-generating server tomorrow under slightly more load or a slightly slower dependency. Watching TTFBTime to First Byte — the time from the start of a request to when the first byte of the response arrives. It's a diagnostic metric (not a Core Web Vital) and a major input to FCP and LCP; ≤0.8 s is good. (time to first byte) as an ongoing early-warning signal — not just a post-mortem metric — is how you catch that drift.

The caveat: TTFB monitoring addresses origin-side slowness. It won’t catch a CDN timing out on a healthy origin, a load balancer misconfigured to give up too early, or a network path problem between hops — those need the emitting hop identified first (the “Where a 504 originates” section above, or the decision tree below). TTFB is a real, durable fix for the common case of a genuinely slow upstream; it’s not a universal one. Once you’ve confirmed the origin is the bottleneck, optimize with caching (page, object, and CDN), faster database queries and proper indexingStoring a crawled page in the search index so it can appear in results. Crawled is not the same as indexed — Google selects what to keep, and indexing isn't guaranteed., autoscaling for load, and sensible CDN upstream tuning.

Why “just raise the timeout” is the wrong instinct

Bumping proxy_read_timeout or the CDN’s upstream timeout can stop the 504 from showing — but it doesn’t make the upstream response any faster. Worse, a longer timeout window under load means requests pile up and tie up worker processes and connections for longer, which can make an overload spiral worse, not better. Raising the timeout is occasionally the right call (for a genuinely long-running, well-understood operation), but as a reflex it masks the real problem.

When downtime is planned or you’re deliberately shedding load, the right tool isn’t letting pages 504 — it’s returning a 503 (with a Retry-After header) so you send search engines a clean, intentional “come back later” instead of a messy timeout.

Diagnosing a 504 in practice

Identify the emitting hop before you guess at a cause — that’s the difference between fixing the actual problem and fixing a symptom:

  • Reproduce it and identify which hop answered. Load it in a browser; hit it with curl and watch time_starttransfer for TTFB; run it through a crawler like Ahrefs Site Audit or Screaming Frog to see whether it’s site-wide or isolated. If you can, test direct-to-origin (bypassing the CDN/proxy) to see whether the origin itself completes.
  • Read the logs. Server and proxy logs tell you which layer timed out and, ideally, on what — the slow query, the stuck upstream, the exhausted worker pool. Correlate by timestamp and request ID across layers rather than assuming.
  • Check Search ConsoleGoogle's free tool for monitoring crawling, indexing, and search performance.. Crawl Stats surfaces response-code spikes and average response time; the Page Indexing reportThe Google Search Console report (formerly Index Coverage) showing how many of your URLs are indexed vs. not indexed, and grouping the not-indexed ones by reason. and URL Inspection show whether Google is hitting timeouts (including “Hostload exceeded”).

Reconciling tools matters: a browser 504, an Ahrefs Site Audit 5xx, and a GSC timeout can all describe the same underlying slow origin seen from different vantage points. Don’t assume three tools mean three problems.

A 504 lives in a small family. A 500 is a generic server error with no more specific code; a 502 is a bad/garbled upstream response; a 503 is an explicit, often intentional “unavailable.” Knowing which one you’re actually returning — and returning the right one on purpose during planned downtime — is half the battle.

Try it live

This is a real endpoint on this site — not a simulation. Hit it from the button, open it in a new tab, or curl -i it from your terminal, and the server answers with the actual status code this article is about.

Open in new tab ↗

Add an expert note

Pin an expert quote

New person? Create their unclaimed profile at /admin/experts/ → Pin a quote first.