Error 524: A Timeout Occurred
Cloudflare reached your server and opened a connection, then waited 125 seconds for a response that never arrived. A 524 points squarely at slow work in the application.
Updated September 2026 · 4 min read
-
Written by
Andrian Valeanu
Founder of Pulsetic
Andrian Valeanu founded Pulsetic. Before that, Designmodo. The 15-plus years in between went into web products, design tools and monitoring software that teams around the world run on.
-
Reviewed by
Ionut Caval
Technical reviewer
Ionut Caval reads every one of these guides before it goes out. Web servers, networking and uptime monitoring are his day job, so the causes and fixes here get checked against how things actually behave in production.
The short version: Reload after a minute: a 524 sits on the website's side and you cannot fix it as a visitor. It means Cloudflare connected to the origin but got no HTTP response within 125 seconds. Run the website yourself? Find the slow request. Raising the timeout is only possible on Enterprise, and it does not make the work any faster.
Key takeaways
- Cloudflare connected to your origin successfully, then waited for an HTTP response that never came. The default Proxy Read Timeout is 125 seconds.
- This is the website's problem, not yours. As a visitor there is nothing to fix beyond waiting and reloading.
- A 524 is the most informative of the Cloudflare 5xx codes: the network path works, the server is up, and the application itself is too slow. That narrows the search to your own code and queries.
- A separate 30 second Proxy Write Timeout also returns 524, and unlike the read timeout it cannot be adjusted on any plan.
- Only Enterprise zones can raise the 125 second limit, up to 6,000 seconds. On every other plan the answer is to make the request faster or move it off the proxied path.
- Error type
- Cloudflare 5xx edge error
- Whose side
- Always the website
- Fix difficulty
- Moderate (website owner)
- Common cause
- Origin connected but responded too slowly
How did you find out this time?
Pulsetic is website uptime monitoring. It checks your URL from outside your network as often as every 30 seconds, confirms any failure from another region, then emails you.
10 monitors free, email alerts on failure and recovery. No credit card.
What does Error 524: A Timeout Occurred mean?
A 524 A Timeout Occurred is a Cloudflare-specific status code that appears when Cloudflare opened a connection to your origin server successfully, but the origin did not return an HTTP response inside the Proxy Read Timeout, which defaults to 125 seconds.
That makes a 524 unusually specific. The network path works, the firewall is not in the way, and the server accepted the request. Something in the application, most often a query or an external call, is simply taking too long. As a visitor there is nothing to fix.
- 524
- Cloudflare status code
- 125s
- Default Proxy Read Timeout
- 30s
- Proxy Write Timeout (fixed)
- 6,000s
- Enterprise maximum
How the Error 524: A Timeout Occurred error appears
The wording changes depending on your browser, device, or server. Here is how this error commonly shows up:
524
A timeout occurred
The origin took too long to respond.
Error 524: a timeout occurredError 524 CloudflareHTTP 524Cloudflare 524 origin time-outA timeout occurred Error code 524Origin Time-out
524 vs 522, 521 and 504
These four look alike on an error page and mean quite different things. The distinction is how far the request got before something gave up.
| Code | How far the request got | Where to look |
|---|---|---|
| 521 Web Server Is Down | Refused at the door. The origin sent a reset. | Stopped web server, wrong port, or a rejecting firewall |
| 522 Connection Timed Out | Never got a connection. No SYN+ACK within 19 seconds. | A firewall dropping packets, or a stale origin IP |
| 524 A Timeout Occurred | Connected, then no HTTP response within 125 seconds. | A slow query, a long export, or a blocking external API call |
| 504 Gateway Timeout | A non-Cloudflare gateway timed out first, usually at 60 seconds. | A proxy or load balancer between Cloudflare and the origin |
Cloudflare timeouts that return a 524
Two different limits produce this code, and only one of them can be changed. Knowing which fired tells you whether to optimise a read or a write path.
| Timeout | Default | Adjustable? |
|---|---|---|
| Proxy Read Timeout | 125s | Enterprise only, up to 6,000s |
| Proxy Write Timeout | 30s | No, on any plan |
| Proxy Write Timeout (Cloudflare Images) | 6.5s | No |
Where the 524 limit sits against other timeouts
Cloudflare is rarely the tightest timer in the stack. If a shorter one fires first you get a different code, which is why a 524 specifically implies everything below it waited longer.
| Layer | Typical default | Code returned on expiry |
|---|---|---|
nginx proxy_read_timeout | 60s | 504 |
nginx fastcgi_read_timeout | 60s | 504 |
Apache ProxyTimeout | 60s | 504 |
| AWS ALB idle timeout | 60s | 504 |
| Cloudflare Proxy Read Timeout | 125s | 524 |
What causes Error 524: A Timeout Occurred?
- A long-running process at the origin, such as a large data export, a report build, or a bulk import.
- A slow or unindexed database query that holds the request open past the timeout.
- An overloaded origin that is struggling for resources and cannot return anything in time.
- A blocking call to a slow external API, where your response time inherits someone else's.
- A write that does not complete inside the fixed 30 second Proxy Write Timeout, for example a large upload.
- A deadlock or lock contention in the application that leaves the request waiting indefinitely.
How to find the cause fast
- Reload once after a minute, then check whether the whole site or only one page fails. A 524 confined to a single URL is an application problem, not an outage.
- Owners: time the request with
curl -w "%{time_starttransfer}" -o /dev/null -s https://yourdomain.com/slow-page. Anything approaching 125 seconds is the culprit. - Request the origin directly, bypassing Cloudflare. If the origin also takes over two minutes, Cloudflare is reporting the problem accurately rather than causing it.
- Enable origin response time logging and find the slowest endpoints. Requests whose 95th percentile sits near the timeout will start returning 524s under any extra load.
- Check whether the work completes server-side after the visitor got the error. That distinguishes a slow request from one that hangs forever, and they have different fixes.
How Error 524: A Timeout Occurred looks from the outside
A 524 arrives as a complete HTTP response from the Cloudflare edge, but unlike a 521 or 522 it arrives slowly, roughly two minutes after the request began. An external check therefore records both a 524 status and a response time near the timeout, and that pairing is the diagnosis: the origin was reachable the whole time and simply never answered. Because 524s often affect one heavy endpoint rather than the homepage, monitoring the specific URL that does the expensive work catches this long before a check of the front page would.
To confirm the exact code a URL returns, or to re-test several at once after a fix, run them through the free bulk URL status checker.
How to fix Error 524: A Timeout Occurred
If you are a visitor
- Wait a minute and reload. A 524 caused by a temporary spike often clears on its own.
- If only one page fails while the rest of the site works, the problem is that specific page. Nothing on your side will change it.
- Check whether it is down for everyone with Is Website Down?
- There is nothing to fix on your device. The request reached the website and the website was too slow to answer.
If you run the website
- Find the slow request first. Origin response time logs, an APM trace, or a slow query log will name it faster than any configuration change.
- Optimise the underlying work: add the missing index, cache the expensive result, or batch the query that walks the whole table.
- Move genuinely long processes off the proxied path. Cloudflare recommends a DNS-only (grey-clouded) subdomain for requests that legitimately run past 125 seconds.
- Better still, restructure long work as a background job that returns immediately and reports progress by polling. That removes the timeout question entirely.
- On Enterprise, you can raise the Proxy Read Timeout up to 6,000 seconds with a Cache Rule or the zone settings API. On every other plan this option does not exist.
- Remember the 30 second Proxy Write Timeout is fixed. If large uploads are failing, the fix is chunking them, not a setting.
Still not fixed? Next steps
- A 524 that only affects one endpoint is an application problem, not an infrastructure one. Profile that request rather than adjusting any timeout.
- If the slow work is legitimate, such as a large export or report, move it behind a DNS-only (grey-clouded) subdomain so it never passes through the proxy, or restructure it as a background job with status polling.
- Check whether the origin finished the work after Cloudflare gave up. A request that completes at 140 seconds server-side while the visitor saw a 524 at 125 confirms the timeout rather than a hang, and points at optimisation instead of a crash.
- On a managed stack, give your host the affected URL and exact timestamps. Origin response time logging is what settles which request is slow, and most hosts can enable it on request.
Code & configuration
Copy-paste starting points. Replace example.com and the paths with your own, and test changes on staging before production.
Find the slow endpoint before changing any timeout
# time the full request, and time to first byte
curl -o /dev/null -s -w "connect: %{time_connect}s\nttfb: %{time_starttransfer}s\ntotal: %{time_total}s\n" \
https://example.com/slow-report
# MySQL: log anything slower than 5 seconds
SET GLOBAL slow_query_log = 1;
SET GLOBAL long_query_time = 5;
How to prevent Error 524: A Timeout Occurred
A 524 rarely takes the whole site down. It hides on the one report, export, or search page that quietly got slower, which is exactly why it tends to be found by a customer rather than by you. Pulsetic checks any URL you choose, not just the homepage, from multiple locations as often as every 30 seconds, and records the response time alongside the status code. Point a check at the endpoint that does the expensive work and you will see the response time climbing toward the limit well before it starts returning 524s.
Learn how Pulsetic's uptime monitoring detects this from the outside, across 15+ locations.
Sources and further reading
The specifications and vendor documentation this guide is written from, plus deeper reading on the parts it only summarises.
Frequently asked questions
-
Is Error 524 my fault or the website's?
The website's. A 524 means the site's own server accepted the connection and then took more than two minutes to answer. Nothing on your device affects that. Reloading sometimes helps if the slowness was a passing spike.
-
How long does Cloudflare wait before returning a 524?
125 seconds by default, which Cloudflare calls the Proxy Read Timeout. A second, separate limit of 30 seconds applies to writes rather than reads and returns the same code. Only Enterprise zones can change the read timeout, and only that one; the write timeout is fixed on every plan.
-
What is the difference between a 524 and a 504?
Which timer expired. A 524 is Cloudflare's own timeout after 125 seconds of silence from an origin it successfully connected to. A 504 is a standard HTTP timeout from some other gateway, typically an nginx or Apache proxy or a load balancer at around 60 seconds. Since those defaults are shorter than Cloudflare's, a 504 coming through Cloudflare usually means something between it and your application gave up first.
-
Can I just raise the timeout to stop the 524?
Only on Enterprise, and only as breathing room. Raising the Proxy Read Timeout stops the error but does nothing to the work behind it, so visitors simply wait longer for a page that is still slow. On every other plan the setting is not available at all, which makes fixing the slow request or moving it off the proxied path the only real option.
-
Why do I sometimes see a 524 a second earlier or later than expected?
Cloudflare documents this. As they migrate their proxy to Pingora, you may observe roughly a one second difference between the timeout you configured and the moment the 524 is actually returned. It is expected behaviour rather than a fault, and the suggested workaround is simply to set the timeout one second higher than you need. It matters mostly if you are testing right at the boundary and wondering why the numbers do not line up exactly.
-
Does a 524 error hurt SEO?
It can, and more quietly than a total outage. Googlebot treats a 524 as a server error, so repeated 524s on a URL reduce how often it is crawled and can eventually push that page out of results. The extra sting is that a 524 costs the crawler over two minutes of waiting before it gets anything at all, which is expensive against a limited crawl budget. Pages that mostly work but occasionally time out are the ones to watch, because they rarely trigger anyone's alerting.
-
Why does the origin finish the work after I already got a 524?
Because Cloudflare gave up waiting, not the server. The origin usually has no idea the client disconnected and carries the request through to completion, which is why you often find a matching entry in the application log timestamped after the visitor saw the error. This is worth knowing for anything that writes: a payment or import that appears to have failed from the browser may have succeeded server-side. Make those operations idempotent so a retry after a 524 does not run them twice.
-
Should I move slow pages to a DNS-only subdomain?
It is Cloudflare's own recommendation for processes that legitimately run past 125 seconds, and it works, because a grey-clouded record bypasses the proxy entirely so no Cloudflare timeout applies. Understand what you give up: that hostname loses Cloudflare's caching, WAF, and DDoS protection, and it exposes your origin IP. For an internal export tool that is usually an acceptable trade. For anything public, restructuring the work as a background job is the better answer.
Trusted by teams at companies around the world
-
Catch the next outage before your visitors do.
2-minute setup · Cancel any time
-
No credit card needed