Wednesday, October 22, 2014

Using perfmon to troubleshoot performance in IIS

When an ASP.NET web site starts having performance issues, in general or when significant load is on the web site (in terms on concurrent users) it can be difficult to narrow down the root cause(s). It often takes several tools to get to the bottom of the issue, and one of the first I tend to use is the Performance Monitor built into Windows aka perfmon.exe

This utility allows you to monitor a very wide variety of system resources: at the basic level such as CPU, memory, network, disk and so on, along with application specific such as IIS, ASP, .NET and even .NET CLR Thread Pool. There are many other variables that can be monitored, too many to list here.

Perfmon Main screen showing live data (processor and memory)
By right clicking on the graph, new counters to monitor can be added by clicking "add counters". In terms of looking at performance problems in IIS, I find the following counters helpful.

  • .NET CLR LocksAndThreads - Useful to see how busy the threads are that are actually processing the code. 

  • Memory, PhysicalDisk, Processor and Network - all provide useful counters for general debugging. For instance, if processor is experiencing high usage and there is memory free, caching may be of use.
  • ASP.NET v 4.0.xxxxx - is helpful to view counters on the requests, session state and worker processes.

No comments:

Post a Comment