Performance Counters for ASP.NET
ASP.NET supports two groups of performance counters: system and application. System performance counters are exposed in the Windows Performance monitor as the ASP.NET performance counter object. Application performance counters are exposed as the ASP.NET Applications performance object.
Note
|
|---|
|
The value associated with each performance counter is updated every 400 milliseconds. When creating a monitoring application, be sure to take this time lapse into account so that your code does not use an obsolete counter value. For more information, see Using System Monitoring Components. |
For additional information on system and application performance counters, see How to: Create Performance Counter Categories, Category and Counter Management and How to: Create Custom Performance Counters.
When monitoring the performance of your ASP.NET Web applications, you can track the performance counters listed in the following table.
|
Performance object |
Performance counter |
||
|---|---|---|---|
|
ASP.NET |
Application Restarts |
||
|
ASP.NET |
Requests Queued |
||
|
ASP.NET |
Worker Process Restarts |
||
|
ASP.NET Applications |
Errors Total |
||
|
ASP.NET Applications |
Requests/Sec |
||
|
Processor |
% CPU Utilization
|
In addition, the following performance counters can be valuable in determining problems with your Web applications' performance.
|
Performance object |
Performance counter |
|---|---|
|
ASP.NET Applications |
Pipeline Instance Count |
|
.NET CLR Exceptions |
# of Exceps Thrown |
|
System |
Context Switches/sec |
The # of Exceps Thrown counter displays the number of exceptions thrown in an application, because these can have performance implications. However, some code paths rely on exceptions for proper functioning. For example, the Redirect method on the Response object throws the ThreadAbortException exception, which cannot be caught. Therefore, it can be useful to track this value along with the Errors Total counter to see if the exception generated an error on the application.
The Context Switches/sec counter measures the rate at which thread contexts are switched by all CPUs in the Web server computer. A high number for this counter usually indicates either high contention in locks or many switches by the thread between user and kernel modes. If you experience this, you should investigate further with sampling profilers and other tools.
ASP.NET supports the ASP.NET system performance counters listed in the following table. These counters aggregate information from all ASP.NET applications on a Web server computer.
Note
|
|---|
|
There is a significant difference between the State Server Sessions counters found in the ASP.NET performance object, which apply only to the server computer on which the state server is running, and the Sessions counters found in the ASP.NET Applications performance object, which apply only to user sessions that occur in-process. |
ASP.NET supports the application performance counters listed in the following table. These counters enable you to monitor the performance of a single instance of an ASP.NET application. A unique instance named __Total__ is available for these counters. This instance aggregates counters for all applications on a Web server (similar to the global counters described earlier in this topic). The __Total__ instance is always available. The counters will display zero when no applications are currently executing on the server.
Note