Is it possible to increase CloudFlare time-out?

Cloudflare doesn't trigger 504 errors on timeout

  • 504 is a timeout triggered by your server - nothing to do with Cloudflare.
  • 524 is a timeout triggered by Cloudflare.

See: https://support.cloudflare.com/hc/en-us/articles/115003011431-Troubleshooting-Cloudflare-5XX-errors#502504error

524 error? There is a workaround:

As @mjsa mentioned, Cloudflare only offers timeout settings to Enterprise clients, which is not an option for most people.

However, you can disable Cloudflare proxing for that specific (sub)domain by turning the orange cloud into grey:

Before:

  • enter image description here

After:

  • enter image description here

Note: it will disable extra functionalities for that specific (sub)domain, including IP masking and SSL certificates.

As Cloudflare state in their documentation:

If you regularly run HTTP requests that take over 100 seconds to complete (for example large data exports), consider moving those long-running processes to a subdomain that is not proxied by Cloudflare. That subdomain would have the orange cloud icon toggled to grey in the Cloudflare DNS Settings . Note that you cannot use a Page Rule to circumvent Error 524.


I was in communication with Cloudflare about the same issue, and also with the technical support of RabbitMQ.

RabbitMQ suggested using Web Stomp which relies on Web Sockets. However Cloudflare suggested...

Websockets would create a persistent connection through Cloudflare and there's no timeout as such, but the best way of resolving this would be just to process the request in the background and respond asynchronously, and serve a 'Loading...' page or similar, rather than having the user to wait for 100 seconds. That would also give a better user experience to the user as well

UPDATE:

For completeness, I will also record here that I also asked CloudFlare about running the report via a subdomain and "grey-clouding" it and they replied as follows:

I will suggest to verify on why it takes more than 100 seconds for the reports. Disabling Cloudflare on the sub-domain, allow attackers to know about your origin IP and attackers will be attacking directly bypassing Cloudflare.

FURTHER UPDATE

I finally solved this problem by running the report using a thread and using AJAX to "poll" whether the report had been created. See Bypassing CloudFlare's time-out of 100 seconds


No, CloudFlare only offers that kind of customisation on Enterprise plans.

  • CloudFlare will time out if it fails to establish a HTTP handshake after 15 seconds.
  • CloudFlare will also wait 100 seconds for a HTTP response from your server before you will see a 524 timeout error.
  • Other than this there can be timeouts on your origin web server.

522 on CloudFlare with SYN/ACK 522 on CloudFlare with ACK timeout

It sounds like you need Inter-Process Communication. HTTP should not be used a mechanism for performing blocking tasks without sending responses, these kind of activities should instead be abstracted away to a non-HTTP service on the server. By using RabbitMQ (or any other MQ) you can then pass messages from the HTTP element of your server over to the processing service on your webserver.

Pub/Sub IPC