Alireza Noori
Alireza Noori

Reputation: 15243

High CPU Usage by IIS even after I stop all the websites

I have an Asp.Net MVC 5.1 website on a VPS and until a few days ago everything went perfectly without any problems. It has 4 GB of RAM, quad core CPU (3 GHz) and a SSD for Windows drive (currently 10 GB free space) so I don't think it's a hardware issue. The problem started after I installed the Wordpress using the Web Platform Installer but that might be just a coincidence. When I restart the VPS everything is smooth. After couple of hours the CPU usage of w3wp.exe goes to 100% and never comes down. I stopped all the websites running and waited for a few minutes and it's still at 100% so I'm sure it's not any of the websites. Is there any way for me to troubleshoot where the problem is coming from? Can you guess where I should start?

Update:

I restarted the DefaultApplicationPool in the server which was related to one of the websites running on the server and it immediately dropped the CPU usage of the IIS to 3. I started it again and it's now going on 3% CPU and the website is fully functional. I think it'll go to 100% soon though!

Upvotes: 1

Views: 3010

Answers (1)

Alireza Noori
Alireza Noori

Reputation: 15243

I followed up the tutorial mentioned by @Andrei and confirmed that it's IIS that's taking the high CPU and it's the main site that's taking the CPU. I confirmed this by creating a new application pool and changing the website's pool to that. After a while the CPU usage went to 100% again and I was sure something was wrong with my website.

Then, after some research I came across this IIS forum thread which gave me some ideas. I used the following command:

%windir%\system32\inetsrv\appcmd list requests

And saw that there are a lot of requests hanged at one action. This action was waiting on a web service which returned a list of SMS messages received by our website and wasn't working at the time. I changed the code and disabled it for now. The IIS is currently using 3% CPU.

Upvotes: 1

Related Questions