Site icon port135.com

High CPU usage in IIS around 4am everyday

I have recently worked with a server that was struggling with high CPU usage only at a certain time of the day: 4am. It sounds odd first but it made sense later. I will discuss the scenario and possible solutions in this post.

Causes and Solutions for high CPU usage around 4am

If you are troubleshooting a similar issue, I would recommend you to checking the settings of the application pool first. Look at the application pool recycle options.

In my case, I saw that the application was scheduled to be recycled at 4am everyday. Additionally, it was also be scheduled to be recycled every 24 hours. This is an obvious conflict. It’s better to keep only one of these settings.

If the issue still exists

If changing the settings doesn’t fix the issue, there might be an issue in the code. I would recommend collecting a dump file with DebugDiag for further troubleshooting. However, you may ask yourself: Why is it happening at 4am if this is a code issue? Here is what the answer might be:

Note: There could be other reasons of high CPU usage. One of them is a specific scenarios with HttpClient usage. Here are more details: High CPU load in IIS web server caused by HttpClient

Why is the Overlapped Recycle disabled?

If this issue is happening in your server because someone disabled the Overlapped Recycle, you may be hesitant to enabling it back. Here is why someone might have disabled it:

However, not using overlapped recycle has more disadvantages than advantages. The biggest disadvantage is that an outage of the site while switching from the current app pool to the new one (Reference 1, Reference 2).

If your application pool is stopped, you may receive 503 error. Here is how to solve this issue: HTTP 503 Service Unavailable (Application pool has been disabled)

Exit mobile version