Bobcares

How to fix ‘503 service unavailable error’ in your websites

by | Mar 24, 2018

In our role as Server administration specialists for server owners, website errors are a commonly encountered issue that we resolve for them.

‘503 service unavailable error’ is one such website error. Recently, we were contacted by a Docker hosting provider who was getting this error in his website.

503-service-unavailable

 

There were multiple sites hosted in the Docker machine, but the 503 error was seen in the backend of only one website.

Whenever the site traffic went high, that was when the ‘service unavailable error’ was noticed.

The site began to slow down. Customer feared that visitors would start abandoning the site, and business would get affected. That’s when he contacted us for assistance.

Needless to say, it was an Emergency situation, and we started working on it through our priority channel : Emergency Support Services.

Today, we’ll see the various solutions we considered, and how you can fix this error if you come across similar situations.

What is “503 service unavailable error”?

A “503 service unavailable error” is an indication that the web server is unable to handle the request temporarily. It can lead to the website being unavailable to the visitors at that time.

The client who consulted us, was offering Docker hosting, and each container hosted a WordPress site. It was one such WordPress site that was giving the error in backend.

While other errors have clear cut reason, 503 error is often an ambiguous one. Many reasons – server wide or site specific – can cause this “service unavailable error”.

What causes “503 service unavailable error”

Anything from an overloaded server to a buggy plugin, can cause a WordPress site to be unavailable. Some of the various reasons we’ve come across in our debugging experience, are:

1. Inadequate server resources

In a shared hosting environment where multiple websites are hosted, server owners often try to achieve high account density, to ensure maximum gains.

Server resources such as memory, CPU, I/O, disk, etc. would be divided among multiple websites hosted in the server. In a docker machine, each container would be allotted a set of limited resources.

When the resources allocated to a container or an account is not enough for its normal functioning, the website hosted in it can give intermittent errors due to this resource shortage.

2. Web server misconfiguration

By default, all web servers come with a common configuration. Many server owners leave this default setting as it is, and build their hosting upon it.

While the default settings may work fine for low density and low traffic web servers, it may not be the optimal setting to handle an increase in the traffic and website count.

If the web server configuration settings (such as connection counts, memory limits, etc.), are not fine-tuned in the server, it can cause “service unavailable error”.

3. High web traffic due to attacks

The access to a website can vary from time to time. A peak sale time or a business growth can pull in valid traffic to a website, which may not have been foreseen by the customer.

But many a time, the web traffic spikes due to attacks or bots or others hack attempts to the site. For instance, a contact form in the site can be abused by attackers to generate a traffic spike.

As most attacks are often intended at causing downtime to the websites by draining out the server or the container resources, such high traffic often leads to “service unavailable error”.

4. Buggy applications or server software

Software applications such as WordPress are often accompanied by a huge set of plugins which website owners install for various features. Not to mention the code customisation and redirects done.

If any code or plugin has a bug or improper setting that can hog down the server resources, the website can crawl and become unavailable to visitors.

Web servers work along with other server software such as database, PHP, etc. If these software are not fine-tuned for optimal performance, they can also be contributing factors for the error.

How to resolve – 503 service unavailable error – in web server

When the customer contacted us complaining about 503 error in his WordPress site, we adopted a step-by-step debugging methodology to resolve the website error.

I. To pinpoint the actual cause of the 503 error, we first examined the web server logs. The location of the web server logs vary based on whether you are using Apache, NginX or IIS web servers.

For Docker, each container has a unique log which records the access details and error messages specific to that container. These logs gave us a hint towards the cause of the error.

II. Next, we examined the resource usage in the server and specific to the website in question. Using custom tools, we monitored the server resources and website statistics.

For websites that give intermittent errors, we debug the issue with the help of tools that retain past records of server resource usage for various time periods.

III. When the resource usage (CPU and memory) for the container was noted to be higher than its allotted values, we dug the access logs further to figure out if the traffic was valid or not.

From our detailed analysis, we could trace out that a particular URL in the WordPress site was being abused by attackers, from different locations around the world.

IV. We then secured the Docker machine with a custom firewall used for cloud servers. After figuring out the abuser IP addresses, we validated the IP addresses and blocked suspicious ones using this firewall.

Further, we reviewed the URL that was under attack, found that it was a contact form, and took actions to protect the website URLs from further attacks.

V. As an additional preventive measure, we scanned the websites in the server for malicious or vulnerable code, and took actions to disable them and protect them from attacks.

We also performed a fine-tuning of the web server configuration, along with the MySQL and PHP settings, to ensure that the web sites are served with the maximum server potential.

After performing these actions, the server load and resource usage for the container returned back to normal and the site started functioning without any errors.

If you are facing a server error, but not sure which configurations to tweak or how to track the attackers, we can help you. Click here to consult a web server expert. We’re online 24/7 and we can assist you in a few minutes.

Conclusion

“503 service unavailable error” is a commonly seen, but confusing web server error. The major hurdle involved in fixing it, is finding the actual root cause of the error. Today we’ve seen various causes for the error and how to resolve it with a steady debugging methodology.

 

NO MORE SERVER ERRORS!

Never again lose customers to website errors! Let us help you.

GET EXPERT ASSISTANCE NOW

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

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

Never again lose customers to poor
server speed! Let us help you.

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

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

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