NewVitalSentinel, redesigned
GuideServer LogsSite Health

504 Gateway Timeout: When Your Server Is Too Slow for Googlebot

What a 504 means, which layer's clock ran out, how Google treats timeouts, and why your log can show Googlebot hanging up with a 499 before any 504 exists.

Martin Stepanek
Martin Stepanek
November 30, 2026
7 min read
Share

Open your access log and filter for Googlebot. Count how many requests ended in a 504, and how many ended in a 499.

Now look at what the top results for 504 gateway timeout tell you to do: refresh the page, raise the timeout, check your logs. Almost none of it covers what Googlebot did while your server was slow.

A 504 is a proxy running out of patience. Googlebot's patience can run out earlier. Your log writes that down as a 499.

Google's documentation covers the rest: slow answers shrink the crawl long before any 504 shows up. It doesn't document the 499.

A 504 means the gateway stopped waiting

MDN defines a 504 (opens in a new tab) as the gateway not getting "a response in time from the upstream server." The gateway is your CDN, load balancer or reverse proxy.

A 502 is a bad answer. A 504 is no answer inside the time limit. The bad-answer case, and how to tell which layer sent the error page, is in 502 Bad Gateway: Find the 502s Googlebot Gets That Uptime Checks Miss.

On Cloudflare, a slow origin usually shows up as a 524, not a 504. Cloudflare's documentation (opens in a new tab) says it connected to the origin, but "the origin did not provide an HTTP response." The default wait is 125 seconds. Plenty of guides still say 100.

Every layer keeps its own clock

A request to a typical site passes several timers: one in the CDN, one in the load balancer and two in Nginx in front of the app.

The Nginx documentation (opens in a new tab) gives both proxy_connect_timeout and proxy_read_timeout a default of 60 seconds. The read timeout applies "only between two successive read operations, not for the transmission of the whole response."

So a page that trickles out bytes can outlive the read timeout. A page that sends nothing for 60 seconds can't.

The shortest clock wins. If your load balancer gives up at 30 seconds, you'll see its 504 long before Nginx's. To find out which one fired, search the Nginx error log for "upstream timed out". The entry names the upstream and whether the read, the connect or the send timed out.

grep "upstream timed out" /var/log/nginx/error.log | tail -20

Googlebot treats a timeout like a server error

Google's status code page (opens in a new tab) doesn't name 504. Its page on network and DNS errors (opens in a new tab) fills the gap. "Google treats network timeouts, connection reset, and DNS errors similarly to 5xx server errors."

Crawling starts slowing down at once. If the URLs stay unreachable, Google says they "will be removed from Google's index within days."

John Mueller made the same point on Reddit in August 2025 (opens in a new tab). He'd only expect the crawl rate to react that fast to "429 / 500 / 503 / timeouts."

Slow is already a problem before the 504

Google's crawl budget guide (opens in a new tab) goes one step further. If "latency increases or response times become longer," the crawl capacity limit goes down. No error needed.

A page that answers in four seconds never throws a 504. It still costs you crawl.

Google publishes no Googlebot fetch timeout. So watch your own answer time.

Google calls TTFB (opens in a new tab) good under 800 ms. I only call it good under 250 ms. Over 500 ms means fix it.

In Google Search Console, Google's troubleshooting page (opens in a new tab) points to the Host availability graphs in the Crawl Stats report. The same report charts average response time. URL Inspection can show "Hostload exceeded" on a page.

To time one URL yourself, run it through the free TTFB test. It splits the response time into DNS, connect, TLS and wait. A slow connect points at the network or the host. A long wait usually means the server is busy building the page.

Your log shows Googlebot hanging up

Nginx writes status 499 when the client closes the connection before the server answers. Cloudflare's documentation (opens in a new tab) says the same. It's logged "when a client closes the connection," and "No 499 HTTP response is sent to the client."

So when Googlebot hangs up first, no 504 exists. Your proxy never reached its timeout. The log holds a 499 and a wait time instead.

You can reproduce the split in a local Nginx container. Give it an upstream that waits five seconds. Set proxy_read_timeout to 2s. A client that waits gets a 504 after two seconds. The error log writes upstream timed out. A client that hangs up after one second gets a 499 in the access log. The error log gets no new entry.

These two requests reproduce the 504 and the 499 against that container:

curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8080/
curl -s -o /dev/null -m 1 http://localhost:8080/

A 499 is a log code, not a Google rule. It shows that the client hung up, and for a verified Googlebot address that client is Googlebot.

To count the codes side by side, run your access log through the free log file analyzer. It lists every bot in the file with the errors it got, and flags the fakes. Check single IPs with the free Googlebot IP checker too. The wider method is in Log File Analysis for SEO: Half My Googlebot Hits Were Fake, and They Hid the Real Error Rate.

On a demo site, the Gave up waiting report in Server Log Monitoring counts exactly those hang-ups.

The Gave up waiting report: Googlebot gave up on 272 requests, 1.6% of its visits, after about 6.9 seconds.Demo workspace: the Gave up waiting report: Googlebot gave up on 272 requests, 1.6% of its visits, after about 6.9 s.

The same report splits the hang-ups by crawler. Googlebot is the one that gives up most.

A table of hang-ups by crawler, with verified Googlebot at 272, far ahead of every other crawler.Demo workspace: verified Googlebot accounts for 272 of the hang-ups, far ahead of every other crawler in the table.

Not every log source records a 499, so an empty report isn't proof.

Treat it as an issue when verified Googlebot gave up on at least 20 requests and 1% of its visits in a week. List the pages, then find those requests in the server log by time to see what made them slow.

A diagram: a 504 is the proxy giving up on the server, a 499 is the client giving up on the proxy first.A 504 is your proxy giving up; a 499 in the log is the client, here Googlebot, hanging up first.

Raising the timeout hides the slow page

The usual fix is to raise the timeout. That treats the symptom. AWS's CloudFront documentation (opens in a new tab) tells you to fix origin latency before you raise the timeout.

Move Nginx from 60 seconds to 120. Your proxy waits twice as long. Googlebot doesn't. Visitors now wait twice as long for the same slow page.

Fix the answer instead:

  1. Find the slow URLs. The Gave up report and your access log rank them.
  2. Turn on the slow query log and read it.
  3. Cache what doesn't change between two visits.
  4. Check that the app has free workers, because a full pool queues requests until something times out.

One exception: a report that truly takes two minutes shouldn't run inside a web request. Queue it and answer at once.

Watch the phases, not just the error

An uptime check tells you the site answered. It doesn't tell you the answer took five seconds.

Split each check into DNS lookup, TCP connection, TLS handshake and server wait. Server wait is the slice that grows before a timeout. On a healthy site it's also almost all of TTFB. On a demo site, each phase gets its own line.

Response time split into DNS, TCP, TLS and server wait, with server wait making up almost all of the first-byte time.Demo workspace: server wait is almost all of the first-byte time, around 200 to 250 ms here, while DNS, TCP and TLS stay thin.

No monitor? Run your slowest templates through the TTFB test once a week. A wait creeping toward 500 ms is your cue to start digging.

Your server is too slow for Googlebot long before it's slow enough for a 504.

Martin Stepanek

Written by

Martin Stepanek

Enterprise Technical SEO Consultant

15+ years building enterprise websites and designing the infrastructure behind them, and 5+ in technical SEO and web performance. My work is making companies findable – not just on Google, but inside ChatGPT and the other AI engines people now ask first. I write a regular newsletter and blog on technical SEO at TechSEO Vitals, and I built VitalSentinel because the gap between something breaking and someone noticing should be minutes, not days.

// newsletter

The VitalSentinel Newsletter

New features as they ship and practical technical SEO tips. One email a week at most.

Unsubscribe any time

// free to start

Know what changed on your site

Page changes, robots.txt and Core Web Vitals from real users, indexing and the Google and AI crawlers in your server logs, plus uptime and SSL, in one app.

1 domain freeNo credit cardAll 13 modules5.0on G2