For instant and easy management of servers, there is a web control panel, which is known as CentOS Web Panel. The web panel enables users to enhance the performance and speed with web applications like Varnish Cache.
However, sometimes users also experience the error, which reads as 503 backends fetch failed because of the misconfiguration. Here we will discuss some ways that will be helpful to resolve such errors. This post is dedicated to discussing the error 503 backend fetch failed and how to resolve the error. So, let’s start!
Why You Get the 503 Backend Fetch Error?
Before proceeding further to discuss how to resolve the error, it is important to get a background of the error about why it appears and what the causes are.
For the web servers, they use a reverse cache proxy, which is known as Varnish, which helps websites to load quickly without taking much time. The process reacts to and accesses the Varnish cache using the port 80. Then the proxy again accesses the backend server to store the pages a cache.
Once they are saved, next time when you request for that page, it will load using the Varnish, which will load the requested pages instantly. But what is the reason we get the error 503 backend fetch failed? Well, when the servers get too many requests and don’t have adequate memory, the server fails to get to the backend connection. As a result, we see the error 503 backend fetch failed on our screen.
Here are the reasons that can cause the error 503 backend fetch failed;
- When multiple requests are queued up, it reads adequate memory to take action on those requests. When it hits the limit, the backend connection gets failed and to connect to the backend web server.
- Another typical reason which causes the error 503 backend fetch failed is the problem with Varnish cache configuration. Those configuration issues include IP address, which is used for Varnish cache configuration is not listed, or Apache and Varnish are utilizing the same 80 port.
How to Resolve the Error 503 backend fetch failed on CentOS?
Here is what you can do to fix the 503 backend fetch error;
1- Assign More Memory
The size of memory for the Varnish cache entirely depends on the requests that you have made to it. It means the more number of requests you made, the more memory it will consume. To do this, you just need to do a proactive analysis of the visitors of the website on the server, and then estimate the memory consumption. Now, you will be able to assign it more memory to prevent the 503 backend fetch failed error in the future.
2- Reconfigure the Varnish
Another way to prevent 503 backend fetch error failed is to configure the Vanish settings. To do this, you are required to adjust its IP address, varnish port, and other related configuration using the CentOS Web Panel. If you think there are still too many requests on the server even when you have adjusted its settings, you have the option to temporarily disable it using the CentOS Web Portal. to do this, the process is easy and here are a few steps that you need to follow;
- Access the CentOS Web Portal using your credentials.
- Locate the Apache Settings dropdown list and click on it.
- Change the Webservers.
How to Solve the Error 503 Backend Fetch Failed on Cloudways?
We have already discussed what Varnish Cache is and how it works. If you want to activate it on your Cloudways server, here is how you can do that;
- Click on the Servers link.
- Click on the Server name you want to open.
- In the Server Management section, click on the Manage Services option.
- From the Manage Services option, activate the Varnish Cache.
Now, if you are getting the Error 503 Backend Fetch Failed on your Cloudways server, below is how you can fix it.
1- Disable Varnish Cache for the Applications
If you are getting the Error 503 Backend Fetch Failed on an app; you have the option to disable it. To do this here is how you can do that;
- Go to the Application Management settings.
- Click on the Application Settings.
- Under the General tab, locate the Varnish option.
- Under the Varnish, you will see the Disable option. Just toggle the switch to the left to turn it off.
- For turning it on, again toggle the switch to the right.
2- Execution and Memory Limit Settings
Another way to solve the Error 503 Backend Fetch Failed is to change the Execution and Memory Limit settings on your Cloudways server. Here is how to do that;
- From the Server Management Panel, click on the Settings and Packages option.
- Under the Basic tab, you will see multiple options with numbers.
- Locate the Execution Limit and set it to 1200.
- Now locate the Memory Limit option and set it to 512.
3- Disabling the WP-CRON on the Applications
Yet another way to resolve the Error 503 Backend Fetch Failed is by disabling the WP-CRON on all the applications. This process will be helpful in the optimization of the memory consumption of the server. This process is pretty simple and here is how to do that;
- From the WordPress installation root folder, launch the WP-COFIG.PHP file.
- Type” define(‘DISABLE_WP_CRON’, ‘true’); ” code without quotes just before the (/* That’s all, stop editing! Happy blogging. */)
- Save the text file and upload it again to your Cloudways server.
That is all about Error 503 backend fetch failed. We sincerely believe that if you are experiencing the same issue, you will be able to resolve it now. For any queries, you are encouraged to write us a comment below.
Q: Does Varnish cache speed up the page loading?
Ans: Yes, the Varnish cache is incredibly fast and boosts the speed to load page instantly.
Q: what will be the fastest speed of Varnish?
Ans: Varnish usually boosts the delivery factor up to 1000x, which entirely depends on the architecture you are using.