5

High CPU

The picture explains it all. We have had a problem with an IIS MVC 5 website hosted on Microsoft Azure over the last several months. The site appears to continually eat up CPU over a few days until it reaches 100% CPU. I have used Perfmon/DebugDiag to capture what is going on when the server hits 100% with no positive findings. I've also monitored IIS worker processes to see if it is any one particular request hanging, but all requests are being processed quickly (until 100%). Grasping at straws - we have had peer checks of code to ensure no bad loops/string concats are occurring.

My guess is this has something to do with the garbage collector... Resetting the app pool fixes the issue (for a few days).

Any insight would be appreciated as to how to debug this further. I have followed this Microsoft article without success: http://www.iis.net/learn/troubleshoot/performance-issues/troubleshooting-high-cpu-in-an-iis-7x-application-pool

Thanks.

5
  • Did you manage to reach a resolution on this? Jun 25, 2015 at 16:28
  • Try using technet.microsoft.com/en-us/sysinternals/bb896653 to inspect the process. You may find multiple app domains running in the worker process or some other quirk.
    – Greg Bray
    Jun 26, 2015 at 5:27
  • @NikolaiDante we did not find a solution to the problem. We added a hack to our deployments to setup our application pool to have a daily periodic restart schedule. Apr 25, 2018 at 13:50
  • How generates the picture ? How you use Perfmon/DebugDiag to capture what is going on when the server hits 100% with no positive finding ? How you monitored IIS worker processes ? can yo do all this programmatically ?
    – Kiquenet
    Jul 2, 2018 at 12:35
  • For Azure App Service (today's name), it is very important to collect dumps when CPU usage is high and analyze them to locate the culprit. Articles like blogs.msdn.microsoft.com/asiatech/2016/01/20/… and serverfault.com/questions/774737/… should be followed (though through the years Azure Portal might look differently).
    – Lex Li
    Nov 17, 2019 at 16:55

1 Answer 1

0

Garbage collection is typically memory related, not CPU related. Of course, you could have objects that have routines in them that are looping and those objects are slowly growing or the time between loop iterations are decreasing. Yes, you need to profile your processes as this would tell you which methods are causing all of the CPU time. I recommend Telerik's JustTrace tool, although there are many others out there.

One other thought, you may think you have disposed of your object but the loop is still running. Consider terminating your loops gracefully with a cancellation token or condition.

1
  • It is more like a comment than an answer.
    – Lex Li
    Nov 17, 2019 at 16:53

Not the answer you're looking for? Browse other questions tagged .