28

There are truckloads of counters available in perfmon for ASP.NET. What are the best (I am thinking of choosing 5-10) that will be the best to monitor in our test environment so that we can feed back to developers.

I am thinking of things like request time, request queue length, active sessions etc.

3 Answers 3

21

For a normal (not performance/stress testing) you would be OK with the following:

  • Request Bytes Out Total (very important especially for web (not intranet) applications)
  • Requests Failed
  • Requests/Sec
  • Errors During Execution
  • Errors Unhandled During Execution
  • Session SQL Server Connections Total
  • State Server Sessions Active

For the performance testing you would probably want things like:

  • % CPU Utilization (make sure you're checking for very low CPU utilisation as well as it might indicate that something is dead)
  • Requests Queued
  • Output Cache Hits
2
  • 6
    How is Request Bytes Out Total important (or even helpful)? It's just a continually growing count of all bytes sent out. May 26, 2009 at 20:45
  • 1
    Can I get those values programmatically using Powershell and WMI ? Jun 23, 2016 at 21:33
9

The ones I use the most are the memory counters. All of them. I know that they aren't specific to ASP.NET, but the only problems I've ever had with a web app were memory issues.

Excessive heap, gen 2 collections and % time in GC are the most important ones. If your time in GC is spiraling out of control it's a sign that your UI and viewstate are too big. A large heap and lots of gen 2 collections says you're keeping too much stuff in memory (inproc session state, for example).

Regular ASP.NET apps based on web controls require lots of objects being created and then destroyed quickly, as a page is reconstructed and then disposed. High gen0 collections isn't bad. Its when you start seeing lots of objects make it into gen1 and then gen2 that suggests you're either leaking memory or are holding onto too much state.

2
  • 2
    Can you be more specific with your numbers? What's 'A large heap' and 'lots of gen 2 connections'? May 26, 2009 at 20:24
  • 2
    My experience is the same as Will's. Most performance problems with asp.net web apps are probably memory related. % time in GC is crucial to monitor. Its hard to specify hard thresholds for % time in GC, but anything averaging over 15% would catch my attention. There should be many more Gen 0 collections than Gen 1, and many more Gen 1 collections than Gen 2. The # Invoked GC should be 0 or very small. If # Invoked GC is close to Gen 2 Collections, the code is explicitly calling GC.Collect and the app will be spending a large % of time in GC. In GC, all threads are paused, so this is very bad.
    – BOS
    Feb 22, 2013 at 17:17
3

Be aware of memory counters when running more than one ASP.NET Application Pool check out the problem at http://blog.dynatrace.com/2009/02/27/can-you-trust-your-net-heap-performance-counters/

Not the answer you're looking for? Browse other questions tagged or ask your own question.