HTTP 524 A Timeout Occurred — Cloudflare Origin Response Timeout
About HTTP 524 A Timeout Occurred
Fix Cloudflare HTTP 524 error when the origin server takes too long to respond with an HTTP response after the TCP connection is established. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: HTTP 524 means Cloudflare successfully connected to the origin but the server did not respond with HTTP data in time. Cloudflare's default timeout is 100 seconds for free and pro plans, 600 seconds for enterprise. The TCP connection was established, but the origin server did not send the HTTP response headers within the timeout window. This commonly affects long-running scripts, large database queries, or file processing operations. Unlike 522 (connection timeout), 524 occurs after the connection is established but before the response is received. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: Long-running PHP/Python script exceeding Cloudflare's 100-second timeout. Slow database query blocking the origin server from responding. Origin server under heavy load with high response times. Large file processing or report generation taking too long. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Optimize slow database queries — add indexes, reduce result sets, use query caching. Move long-running tasks to background jobs (queue workers, cron jobs) instead of synchronous HTTP requests. Increase PHP max_execution_time or Python timeout settings on the origin server. Use Cloudflare Workers or streaming responses for operations that legitimately take a long time. Consider upgrading to Cloudflare Enterprise for configurable timeout limits up to 600 seconds. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our HTTP Status Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
Can I increase the timeout on a free Cloudflare plan?
No. Free and Pro plans have a fixed 100-second timeout. You must optimize your application to respond within that window, or upgrade to Enterprise for up to 600 seconds.
Overview
Fix Cloudflare HTTP 524 error when the origin server takes too long to respond with an HTTP response after the TCP connection is established.
Key Details
- HTTP 524 means Cloudflare successfully connected to the origin but the server did not respond with HTTP data in time
- Cloudflare's default timeout is 100 seconds for free and pro plans, 600 seconds for enterprise
- The TCP connection was established, but the origin server did not send the HTTP response headers within the timeout window
- This commonly affects long-running scripts, large database queries, or file processing operations
- Unlike 522 (connection timeout), 524 occurs after the connection is established but before the response is received
Common Causes
- Long-running PHP/Python script exceeding Cloudflare's 100-second timeout
- Slow database query blocking the origin server from responding
- Origin server under heavy load with high response times
- Large file processing or report generation taking too long
Steps
- 1Optimize slow database queries — add indexes, reduce result sets, use query caching
- 2Move long-running tasks to background jobs (queue workers, cron jobs) instead of synchronous HTTP requests
- 3Increase PHP max_execution_time or Python timeout settings on the origin server
- 4Use Cloudflare Workers or streaming responses for operations that legitimately take a long time
- 5Consider upgrading to Cloudflare Enterprise for configurable timeout limits up to 600 seconds