Friday 1 June 2012

Gather performance counters log

And one more post about gathering information for debugging. Along with dumps, it would be always great to have performance counters log - to see how process' memory and processor time has changed over the time, and compare this log with things we can dig in dumps.

First of all, press Windows' Start -> Run and call perfmon (Performance Monitor):

0. Start perfmon

And step-by-step screenshots:


1. Create your own data collector set

2. Name it and choose advanced mode

3. Include performance counters

4. It would be good to check counters every second

5. The most important step. Add all counters that you consider as helpful for your issue.

Counters, that you need to select in most cases:

  • .NET CLR Memory section: almost everything.
    • # Bytes in all Heaps
    • # GC Handles
    • # Gen 0/1/2 Collections
    • # Induced GC
    • # Large Object Heap size
    • # Total Commited bytes
    • # Total Reserved bytes
    • # Get 0/1/2 Heap size
    • Actually, you won't miss anything if you select the whole section. Do not forget to select your exact w3wp process for each counter!
  • Process section:
    • # Processor Time
    • # Private bytes
    • # Virtual bytes
    • Do not forget to select your exact w3wp process for each counter!
  • Processor section:
    • # Processor Time
    • # User Time
  • ASP.NET Apps v2.0.50727 (or ASP.NET Apps v4.0.30319) section, depending on AppPool settings:
    • Everything related to Requests: Requests Total, Requests/sec, Requests Succeeded, Requests Failed etc.
6. Choose a root directory for performance logs

7. If you want to run counters under specific account, choose it here
After that you should start your set and run application for some time, make it to experience the issue that it's  suffering from. Then stop Data Collector set and found .blg file in the folder you have specified on 6th step. This .blg file now can be opened in performance monitor, and will show you nice graph according to Scale settings of your counters. Scale/Graph settings may be chosen at any time, and allow you to process already collected log in the way you want.

No comments:

Post a Comment