Skip to content
Webmaster Tools
Inspect & debugHTTP Status Codes524 A Timeout Occurred

524 A Timeout Occurred

What Cloudflare error 524 (a timeout occurred) means, why Cloudflare gives up after 100 seconds without a response, and how to speed up or move long requests.

All status codes

What 524 means

524 is not a standard HTTP status code; Cloudflare's edge sends it. It means Cloudflare connected to the origin and sent the request, but the origin didn't return an HTTP response before Cloudflare's proxy read timeout, which is 100 seconds by default. The connection worked; the application was just too slow.

HTTP/2 524
server: cloudflare
cf-ray: 8c1f2a3b4d5e6f70-SJC
content-type: text/html

<title>example.com | 524: A timeout occurred</title>

The origin often keeps working after Cloudflare gives up, so the task may finish (an import, an email batch) even though the visitor saw an error. Retrying can run it twice.

Common causes

  • Long-running requests: reports, exports, imports, video or image processing, bulk updates done inside a single HTTP request.
  • Slow database queries or lock contention that stretch a normally fast page past 100 seconds.
  • A slow upstream API that the origin waits on synchronously.
  • An overloaded origin where requests wait in a queue for a free worker before they even start.

How to fix it

  1. Find the slow requests. Your web server's access log with request times (nginx $request_time, Apache %D) shows which URLs take close to 100 seconds. Profile them and fix the query, add caching or an index.
  2. Move long work to the background. Have the request start a job and return at once (for example 202 Accepted with a job ID), then let the page poll a status URL or receive a notification when it's done. This is the durable fix.
  3. Send a response early. A response that starts within the timeout isn't cut off by this limit, so streaming results or progress can work for tasks that must stay in one request.
  4. Bypass Cloudflare for long tasks. Put admin tools or batch endpoints on a hostname whose DNS record is set to DNS only (grey cloud), so requests go straight to the origin. That hostname then exposes the origin IP and loses Cloudflare's protection, so lock it down.
  5. Raise the timeout (Enterprise only). Cloudflare lets Enterprise plans increase the proxy read timeout (up to 6,000 seconds). On other plans the 100-second limit is fixed.

Line up the origin's own timeouts too: if nginx's proxy_read_timeout or PHP's max_execution_time is shorter than 100 seconds, the origin gives up first and you see its 504 or 502 through Cloudflare instead.

524 and SEO

Googlebot receives the 524 as a server error. A page that takes 100 seconds to render is a problem long before the timeout: Google crawls less on a slow server, and URLs that repeatedly fail are eventually dropped. Pages meant for search should answer in well under a second; keep slow work out of crawlable URLs.

Measure how long a URL takes with the HTTP Request Builder, or check its status through Cloudflare with the Redirect Checker.