What is a 503 error?
Error 503 (Service Temporarily Unavailable) in most cases means that you have exceeded one of the resource limits, provided with your hosting plan. No worries, this article shows the most popular reasons and how to solve the issue.
In short, there are two best solutions on how to fix 503 error:
Upgrade your current hosting plan, so it would have even more resources than your current plan
Optimize your website as much as possible by using recommendations from GTMetrix or similar services
Reason 1 - Exceeded CPU, Memory, and Processes limits
In most cases, when error 503 occurs, you have reached the limit of CPU, physical memory, or the number of simultaneously running processes. To find out for sure, open your hosting accounts hPanel, find Order Usage and check the usages of your plan.
Your graphs should not reach the red lines:
Here is an example of exceeding memory resources:
Order usage graphs are updated every 15-30 minutes, if an error has just appeared on the site, you may need to wait and check the current values
What to do when your website is exceeding these limits?
There are several options for fixing exceeding resources:
1. Pay attention to visits to the site. If you see values that are unusual for your site (for example, you usually have 100 visitors, and at some moment of time you get 1000), a DDoS attack might have begun on your site. To protect your site from DDoS, you will need to set up Cloudflare (if it has not already been configured with your website) and put it on the Under Attack mode:
2. If your website exceeded the number of simultaneously running Processes or Entry processes:
To get back online quickly you can stop the running processes. It can be done at the top of the Order Usage page:
This solution is temporal. You will need to find out the reason for so many processes running simultaneously
3. If a large resource consumption occurs periodically (for example, once every 6 hours), check the planned/cron tasks of your site. Most likely you have set the execution of some action or script, which requires more resources than your plan provides.
4. The most important and effective solution is website optimization. Here, a very simple rule applies: the more the site is optimized, the less resources it uses and the faster it opens. Sounds good, right?
5. If you checked all the options, optimized the site as much as possible, but your website still consumes almost all resources, it looks like your site has outgrown your current hosting plan. This is absolutely normal and naturally occurs during the development of the website. All you need to do in this case is upgrade your hosting plan to a higher one.
As soon as you upgrade to a higher hosting plan, the remaining money from the previous plan will be recalculated and added as additional days to your hosting plan
Reason 2 - Exceeded inodes and disk space limits
If a 503 error appeared on the site, and the use of resources is small, it may be a matter of using disk space and/or inodes. You can see the usage data on your hosting account dashboard:
You can also refresh data manually by clicking on the 🔃 button below the values.
What to do when you exceeded disk usage and/or inodes?
If your site has exceeded the limit of inodes or the amount of disk space, there are several options for resolving the situation:
Delete all unnecessary files (cache files, duplicates, any old backup files, etc.). If you worry that you accidentally delete something important for the site to work, you can generate a backup in advance
Upgrade your hosting plan: with a higher hosting plan you will receive more resources
In addition to the first option, you can also integrate Google Drive into your work on the site: a free plan of Google Drive offers 15 GB of disk space, which you can use to store large files (such as videos and images), and add links to them on the site.