25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Here’s how to fix – Cloudflare error 524

by | Oct 18, 2019

Cloudflare is a very popular CDN that facilitates faster loading of websites. But if not configured right, the website can end up showing Cloudflare related errors.

One such issue is Cloudflare error 524. This is mainly caused due to long-running processes on the server, due to which Cloudflare fails to complete the connection.

At Bobcares, we resolve different types of website errors, which includes Cloudflare errors as well, as a part of our Server Management Services.

Today, let’s see what causes this 524 error and how our Support Engineers fix it.

 

Why Cloudflare error 524 show up?

Cloudflare has set a timeout of maximum 100 seconds for non-Enterprise users. For Enterprise users, this value can be increased up to a limit of 600 seconds.

Cloudflare normally creates a TCP connection to the origin server, and it waits for this timeout period of 100 seconds, for the origin server to respond.

If there is no response sent by the origin server within this time, then Cloudflare will close the connection and will throw an error 524 in the web page.

 

How we fix Cloudflare error 524?

The 524 error is usually caused due to long-running processes on the server. It includes PHP, web server or database processes.

Recently, one of our customers approached us with the error Cloudflare Error 524: A timeout occurred.

Let’s now see how our Support Engineers fixed this error.

 

1. Check the load on the server

The load on the server is the main cause for this error to occur. So our Support Engineers started to troubleshoot this error by checking the load on the server using the command

top -c

There were too many PHP processes running on the server. So we killed all those processes from the server.

Also, there were too many sleep connections in MySQL. So, we started checking the processes in the MySQL.

We used the command mysql to get into the MySQL command prompt and executed the below command to check the MySQL processes:

show full processlist;

This provided the list of all processes related to MySQL. Later, we killed all those processes as well.

But killing the processes or restarting the service was only a temporary fix. To prevent the recurrence of the error, we dug deeper and performed tweaks in the culprit service.

 

2. Check the hits on port 80

Too many website hits from a particular IP can also cause a tremendous effect on the server and its load. This could be due to any attacks or improperly coded scripts.

So we checked if there were too many hits from any particular IP. We used the below command to check the IP hits for the website.

netstat -an | grep 80

This command will provide the list of the IPs from which the website is receiving too many hits. We decided to review this list and block any suspicious or unwanted IP addresses.

So we blocked few IPs using the command

iptables -A INPUT -s xxx.xx.xx.x -j DROP

At last, we restarted the Apache using the command

systemctl httpd restart

This helped to lower the website hits and also the load on the server. This also ensured that only valid traffic is served by the origin server.

Finally, Cloudflare was able to make a connection with the server, and loaded the website instead of Cloudflare error 524. We also configured a firewall in the server to avoid such issues from happening again.

[Need any further assistance with Cloudflare error? – We’ll help you]

 

Conclusion

In short, the Cloudflare error 524 is caused mainly due to long-running processes on the server or too many website hits. Today, we saw how our Support Engineers fix this error.

3 Comments

  1. Nani

    Hi, as a website developer, how can we solve this or another way as a backup plan if this case happening again?

    Reply
    • Sijin George

      Hello Nani,
      Apologize for the delay in reply. 524 errors can be related to host server settings. If you need further assistance, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF