Cloudflare error 524: a timeout occurred

Updated 11 October 2026

Short answer

Error 524 means your server is up and accepted the request, but it took more than 125 seconds to send the page back, so Cloudflare stopped waiting. Something on that page is very slow: a big database query, an export, a report, or a call to another service. Or the server is so short of resources that everything is slow. Find which URLs time out, then find the slow step.

What's the problem

Some pages, often reports, exports, imports or admin screens, spin for about two minutes and then show "Error 524: A timeout occurred" on a Cloudflare page.

Why it happens

  • A slow database query, often on a large table without the right index.
  • A long task run inside the request, like generating a big file or sending many emails.
  • Waiting on a slow outside API.
  • The server is starved of CPU or memory, so everything slows down.

How to fix it

  1. Find which URLs return 524. It's usually a small number of pages.
  2. Time the slow step: check your app logs and database slow-query log for those requests.
  3. Fix the query or add an index, or cache the result.
  4. Move long tasks to a background job and let the user know when it's done.
  5. Check server resources if every page is slow.
  6. Serve long-running admin tasks from a hostname not proxied by Cloudflare, only if they truly must take longer than two minutes.

What Preventionlabs checks

One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go; uptime checked every 5 minutes, with an email when the site goes down and when it is back. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when; your SSL mode and the other settings that commonly cause this; which requests the firewall blocked, by Cloudflare's own rule names; recent deploys and account changes, with their times; DNS changes in the last 7 days.

Run your free report

Your first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.

Sources

  1. Cloudflare: Error 524official docsError 524 indicates that Cloudflare successfully connected to the origin web server, but the origin did not provide an HTTP response before the default 125 seconds Proxy Read Timeout .
  2. Cloudflare: Error 524official docsThis can happen if the origin server is taking too long because it has too much work to do, for example, a large data query, or because the server is struggling for resources and cannot return any data in time.

Preventionlabs is independent and not affiliated with Cloudflare. Product names are used only to describe the problem.

← All of Cloudflare errors