Cloudflare displays Error 524: A Timeout Error Occurred when it connects to a web server but receives no HTTP response after waiting:

After opening a TCP connection to the origin server, Cloudflare normally waits up to 100 seconds for a response.
Cloudflare uses HTTP to transfer data once that connection is established.
Need the fixes? Click here to skip the technical explanation.
What is Cloudflare Error 524: A Timeout Error Occurred?
While an erroneous connection will throw a more detailed error code for the given problem (like error 520 or error 521), if no connection is ever established at all you’ll see Error 524: A Timeout Occurred. The 524 error usually signals some sort of server error possibly due to a misconfigured script or a web application’s processes crashing.

Too many people using the server can leave it unable to handle the activity, causing a timeout error.
How To Fix Cloudflare Error 524: A Timeout Occurred
- Refresh The Webpage
- Reinstall The Application
- Check Your Server Load
- Upgrade Your System
- Check Your Traffic On Port 80
- Move to a Subdomain
- Modify Your PHP Settings
- Contact Your Hosting Provider
A user’s report of a timed-out connection does not necessarily mean the fault is yours.

Check the user’s setup first to rule out a problem at their end.
1. Refresh The Webpage
Refresh the page. If it still fails, close and reopen the browser; a restart sometimes resolves the cause.
If that does not work, try clearing the cache & cookies before the next step.
Restarting the browser does not clear these automatically. A damaged cache entry or cookie may be the only thing preventing the page from loading.
2. Reinstall The Application
For an error affecting an application or game, try reinstalling it.
Ask your hosting provider to check that the server has not been compromised.
After restoring access, check your server’s traffic to see whether other users may have the same problem.
Once you have ruled out the user’s computer as the main cause, troubleshoot the Cloudflare web server with these steps.
3. Check Your Server Load
Excessive server load most commonly causes Error 524: A Timeout Occurred.

Check the origin server’s load using the Cloudflare CLI with this command:
top -cThe output lists processes currently running on your web server.
Identify tasks consuming high amounts of CPU and bandwidth.
For instance, if too many PHP applications are running procedures at the same time, terminate them all.
This may briefly interrupt users’ activity, but it lets the server accept traffic again.
Too many sleeping MySQL connections can also accumulate and cause problems.
Check for these with the following command at the MySQL prompt:
show full processlist;Clearing error 524 with these steps indicates progress, though the fixes are temporary.
The processes that overloaded the server can build up again. Continue investigating to find the underlying cause.
4. Upgrade Your System
Recurring Error 524 is a reason to inspect your server hardware. Overloaded memory or CPU may be responsible.
Error code 524 may indicate that your web server needs a hardware upgrade, however frustrating that may be.
Modern equipment should keep loading times below 100 seconds and avoid the Cloudflare error.
5. Check Your Traffic On Port 80
A website normally handles traffic spikes. Error 524 indicates that its traffic is abnormal.

A faulty script or DDoS attack could flood the server with HTTP requests. Use this server command to inspect IP address requests to the site:
netstat -an | grep 80
Block suspicious IP addresses spamming the server with this command:
iptables -A INPUT -s ###.##.##.### -j DROP
Restart Apache afterwards:
systemctl httpd restart
Check HTTP traffic regularly for spam. Also check that server bandwidth can handle traffic as your site grows.
Your hosting provider may let you configure automatic alerts for prolonged activity spikes or suspicious connections.
6. Move to a Subdomain
Once you know the cause and have ruled out a DDoS attack, move the processes responsible to a subdomain to avoid Error 524.
Set up these subdomains outside your Cloudflare DNS app.
These “grey clouded” domains can run processes in the background and send server updates without leaving the HTTP connection open.
Cloudflare can then handle incoming requests while the web server runs the demanding processes separately.
Ask your hosting provider for subdomain configuration instructions specific to its service.
7. Modify Your PHP Settings
If your server runs PHP scripts, set max_execution_time in php.ini to your chosen number of seconds.
For scripts that take longer to run, extending load times to 2 minutes is common practice.
120 seconds allows slightly more time than the default 100 seconds. That extra time is often enough for PHP scripts to finish before error 524 occurs.
8. Contact Your Hosting Provider
Contact your host if the previous steps leave you unable to resolve the issue.

Problems at the host’s data centre can cause Error 524 for reasons outside your control.
Send the host the error code and the time zone where it happened, along with the affected URL.
Those details help the host identify and resolve the problem quickly.

