ReviewHostingASP.NET – When you use Windows hosting in shared server to host your ASP related website, sometimes you may find yourself run into an “503 Service Unavailable” error. Well in this article, we will tell you in detail the reasons why you got “503 Service Unavailable” and guide you to take the right action in fixing this error.
“503 Service Unavailable” Error – Error Application
A code bug may cause a site’s application pool crashed, then it’s resulting to “503 Service Unavailable” error. If you can change the source code, you’d better add the following logging function to Application_Error of Global.asax.cs. And then, you’re able to find some clues in the log file if you confront this error next time. For example, read carefully the following code:
protected void Application_Error(object sender, EventArgs e)
string logFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs.txt");
using (StreamWriter sw = new StreamWriter(logFilePath, true, System.Text.Encoding.UTF8))
“503 Service Unavailable” Error – .NET CLR Version
Once your .NET CLR version is not set correct, your website couldn’t work properly. Some web hosting providers only provide 1 dedicated application pool for each hosting account in a Windows shared server. So, when you run more than 1 website with different .NET framework hosted with one account, they will get conflicted with each other.
For example, you can successfully run a website named X.com when you use .NET 3.0. However, when you try running another website named Y.com with .NET 4.0, it’s very likely for you to run into “503 Service Unavailable” error at X.com. This is because the operation of Y.com updated the shared application pool to .NET CLR Version 4.0. By using local or remote IIS management, you are able to open your IIS Manager >> application pool. Then click Advance Settings to pick the correct ASP.NET pipeline.
“503 Service Unavailable” Error – The Limitation of Web Hosting
The limitation that web hosting has set could lead into “503 Service Unavailable” error. Most hosting providers have set limitation of CPU and private memory, though they may not state the fact in public. They set the limitation to avoid the server being overused by one user.
- CPU Limit. The latest IIS versions permit web hosting provider to configure the CPU limit of an application pool so that the worker process of your website is able to use a certain amount of CPU at maximum. When your site comes with a large number of traffic or confronts a complicated situation at one time, the limit will be exceeded and your website worker process will be disabled. Before the worker process is able to restarted, you may run into this “503 Service Unavailable” error. Just check CPU limit for an application pool in your local Internet Information Services. If you run out the limit percentage, the worker process of your website is disabled and will be restarted in 5 minutes. During this period, you will experience the “503 Service Unavailable” error.
- Private Memory Limit. Besides CPU limit, the private memory limit may also cause the same problem. It indicates that when your site uses up more than the limited maximum memory, the worker process of your site will be recycled automatically. Then, there is an “503 Service Unavailable” error temporarily before it is restarted.
If your site constantly occupies more than 500 MB memory or 10 percent of local server CPU, then you should optimize your codebase. To fix the problem in this case, you can contact your web hosting technical support team for the 2 figures, and get to know the right expectation. Make sure you choose the right Windows hosting provider whose technical support will ready to help you in fixing any problems. As the leading among ASP.NET hosting provider in Europe, HostForLIFE.eu gives you tools, power, reliability and flexibility with all of their ASP.NET hosting plans. For over 10 years, they has been providing world-class web hosting with award-winning technical support and service.
“503 Service Unavailable” Error – Enable 32-Bit Applications
If “503 Service Unavailable” error is not led by the above 3 reasons, enable 32-Bit applications is another possible reason for “503 Service Unavailable” error. For your information, the Classic ASP site can only work in an environment with 32-bit. You’re likely to confront this error if you run a .NET site in an environment with 64-bit and it is hosted with a Classic ASP site or run a site with 64-bit set default by a web hosting provider. Another reason is your ASP.NET website is specifically compiled with 32-bit or 64-bit environment, but it is hosted with another mode. Also, your ASP.NET website requires library that run with 32-bit or 64-bit environment, but it doesn’t operate that way. You have to check Application Pool Bit Mode setting, if you don’t want to face “503 Service Unavailable” error.