Error Codes Wiki

HTTP 524 A Timeout Occurred — Cloudflare Origin Response Timeout

Error5xx server error

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

  1. 1Optimize slow database queries — add indexes, reduce result sets, use query caching
  2. 2Move long-running tasks to background jobs (queue workers, cron jobs) instead of synchronous HTTP requests
  3. 3Increase PHP max_execution_time or Python timeout settings on the origin server
  4. 4Use Cloudflare Workers or streaming responses for operations that legitimately take a long time
  5. 5Consider upgrading to Cloudflare Enterprise for configurable timeout limits up to 600 seconds

Tags

cloudflare524timeoutslow-responseperformance

Related Items

More in 5xx Server Error

Frequently Asked Questions

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.