Iis – CPU being pushed to 100% by a process, trying to track and eliminate the problem

cpu-usageiissqlworker-process

I am having trouble with the web servers CPU getting stuck at 25%, then 50%, then 75% until finally maxing out at 100%. Which we are guessing may be some slightly slower SQL queries stacking up, but cannot replicate the problem

Trying to get to the bottom of the problem, we started looking at the settings on IIS (7), we came across the option to set 'web server processes' to more than 1, thinking this could free up and increase the processes available to users queries, but as soon as we did this it broke our application, which we later discovered is likely to be because we use sessions, and the web server processes do not keep sessions from the same user.

So the question is, is there a setting that will allow us to continue using sessions, but also allowing multiple worker processes?

or, does anybody have any thoughts on what could be causing the uplift in cpu usage?

Thanks in advance for any advice

Best Answer

On Maximum Processes: This is called Web Gardening - unless your app is stateless, you can't do that. Plus, in most cases # processes won't improve scalability, because Windows schedules threads, not processes.

To work out what's wrong:

  • Use the Worker Processes view at the Server level in IIS Manager.

  • Within Worker Processes, all the W3WPs will be listed, and the applications they belong to.

  • You can then look at the running requests in each process by right-clicking it.

If that's still not enough to narrow down the cause, you'll need to use a sampling profiler or debugger to determine what the app's trying to do. XPERF from the Windows Performance Toolkit, or DebugDiag, or WinDBG, or Process Explorer could be used to get an idea of what it's doing.

Related Topic