
Cloudflare Error 524 means Cloudflare successfully connected to your origin server and sent an HTTP request, but your server didn't respond within 100 seconds.
Cloudflare's proxy has a 100-second timeout. If your server takes longer than that to send back any response, Cloudflare terminates the connection and shows a 524 to the visitor.
| Error | What happened |
|---|---|
| 521 | Server refused the TCP connection |
| 522 | TCP handshake completed, but server didn't respond to HTTP request in time |
| 523 | Server couldn't be reached at all |
| 524 | Connected fully, sent request, but no response within 100 seconds |
A 524 is specifically about a long-running operation on your server that's taking more than 100 seconds to complete.
The most common cause. A complex query, a missing index, or a query scanning a very large table can take minutes. If a web request triggers one of these, the 100-second clock runs out before the query finishes.
File uploads, image resizing, PDF generation, data exports — any operation that processes large files server-side can exceed 100 seconds for big inputs.
If your application makes a request to a third-party API as part of handling a web request, and that external service hangs indefinitely, your server waits and Cloudflare eventually gives up.
Machine learning inference, large data transformations, or similar CPU-bound tasks triggered by a web request can easily exceed 100 seconds.
A server that's processing too many requests simultaneously can slow down to the point where even simple operations take much longer than usual. Individual queries and processes that are normally fast start queueing up and taking much longer.
This is the right long-term fix for most 524 scenarios. Instead of processing a heavy operation synchronously within the HTTP request:
This pattern works for file processing, report generation, bulk operations, and any task that doesn't need to complete before the response is sent.
If your code calls external services, always set a client-side timeout:
// PHP with cURL
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // 10 second max
// PHP with Guzzle
$client->request('GET', $url, ['timeout' => 10]);
// Node.js with fetch
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 10000);
fetch(url, { signal: controller.signal });
Use EXPLAIN in MySQL or PostgreSQL to see how a query is being executed. Missing indexes on large tables are the most common cause of queries that unexpectedly take very long.
EXPLAIN SELECT * FROM large_table WHERE unindexed_column = 'value';
Add an index if needed:
CREATE INDEX idx_column ON large_table (unindexed_column);
For specific endpoints that legitimately need a long time, consider handling the initial request at the Cloudflare Workers level and polling for completion — bypassing the 100-second limit for the origin.
Enterprise plans allow customising Cloudflare's proxy timeout beyond 100 seconds for specific routes. This is a workaround, not a fix — addressing the underlying slow operation is always preferable.
524 errors mean your site is returning errors to visitors. Even if the underlying cause is a specific slow endpoint rather than a full outage, it affects user experience and SEO.
Domain Monitor detects when your site starts returning errors and alerts you immediately. Pair this with response time monitoring — a gradual increase in response times is often an early warning that a 524 is coming before it actually starts hitting users.
Check out our guide to uptime monitoring best practices for more on building a robust monitoring setup.
Generative AI creates new content — text, images, code, and more. This guide explains how it works, what tools are available, and where it's genuinely useful versus overhyped.
Read moreCursor AI is an AI-powered code editor built on VS Code. Learn what it does, how it works, and whether it's the right tool for your development workflow.
Read moreClaude Opus is Anthropic's most capable AI model, built for complex reasoning and demanding tasks. Learn what it does, how it compares, and when to use it.
Read moreLooking to monitor your website and domains? Join our platform and start today.