For more information, see the IIS Help documentation.
ASP. NET performance counters
ASP. NET supports two sets of performance counters: system and application. The formerASP. NETPerfMon in the performance counter object; the latter is inASP. NET ApplicationsPublic in the performance object.ASP. NETIn the performance objectState Server SessionsCounters (applicable only to the server computers on which the server is running) andASP. NET ApplicationsIn the performance objectSessionsThere is a large difference between counters (only applicable to user sessions in processes.
Note:The value associated with each performance counter is updated every 400 milliseconds.
When monitoring the performance of ASP. NET Web applications, you should always keep track of the performance counters listed in the following table.
Performance object |
Performance counters |
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 |
% CPU UtilizationThe counter monitors CPU usage on the Web server computer. Regardless of the client load, low CPU usage or failure to reach the maximum CPU usage means there is a competition for resources or locks in the Web application.
In addition, when determining Web application performance problems, the performance counters listed in the following table are very useful.
Performance object |
Performance counters |
ASP. NET Applications |
Pipeline Instance Count |
. Net clr Exceptions |
# Of Exceps Thrown |
System |
Context Switches/sec |
# Of Exceps ThrownThe counter displays the number of exceptions thrown in the application because they may adversely affect performance. However, some code paths must depend on exceptions to work properly. For example,HttpResponse. RedirectMethod always raises an exception that cannot be capturedThreadAbortException. ThereforeErrors TotalThe number of exceptions that the counter traces to check whether exceptions generate errors in the application is more useful.
Context Switches/secThe counter measures the rate of all CPU switching thread context in the Web server computer. If the counter value is large, it indicates that the lock competition is fierce, or the thread switches frequently between the user and the kernel mode. You may also need to use the Sampling Analyzer and other tools for further analysis.
The following list detailsASP. NETAndASP. NET ApplicationsCounters in the performance object.
ASP. NET system performance counters
ASP. NET supports the following ASP. NET system performance counters. They collect information about all ASP. NET applications on the Web server computer, or they are generally applied to the systems of ASP. NET servers running the same application. They may contain Web sites and Web parks.
-
Application Restarts
-
The number of times the application has been restarted during the lifetime of the Web server. Every occurrence
Application_OnEnd Event. Application restart may occur due to the following reasons: Change the Web. config file, change the Assembly stored in the Application \ Bin directory, or make too many changes to the Web table single page. An unexpected increase in this counter may mean that unknown issues will cause the Web application to close. In such cases, the cause should be investigated as soon as possible.
Note:This value is reset every time you restart the Internet Information Service (IIS) host.
-
Application Running
-
The number of applications running on the server computer.
-
Requests Disconnected
-
The number of requests that are disconnected due to a communication failure.
-
Requests Queued
-
The number of requests waiting for service in the queue. When this value increases linearly with the client load, the Web server computer has reached the maximum number of concurrent requests it can process. The default maximum value of this counter is 5,000. You can change this setting in the Machine. config file of your computer.
-
Requests Rejected
-
Total number of unexecuted requests due to insufficient server resources. This counter indicates the number of requests that return the 503 HTTP status code (indicating that the server is too busy.
-
Request Wait Time
-
The number of seconds that the most recent request is waiting for processing in the queue.
-
Session State Server Connections Total
-
Total number of computer session state connections that store off-process session status data.
-
Session SQL Server Connections Total
-
Total number of session state connections of the Microsoft SQL Server database that stores session status data.
-
State Server Sessions Abandoned
-
The number of user sessions that have been explicitly abandoned. They are Sessions terminated by a specific user, such as closing a browser or browsing to another site. This counter is only used for running status server services (
Aspnet_state.
-
State Server Sessions Active
-
The number of active user sessions. This counter is only used for running status server services (
Aspnet_state.
-
State Server Sessions Timed Out
-
Number of user sessions that are inactive due to the user's inactive status. This counter is only used for running status server services (
Aspnet_state.
-
State Server Sessions Total
-
The number of sessions created during the lifetime of the process. This counter is
State Server Sessions Active,
State Server Sessions AbandonedAnd
State Server Sessions Timed Out. This counter is only used for running status server services (
Aspnet_state.
-
Worker Process Restarts
-
The number of times the worker process has been restarted on the server computer. If a work process fails unexpectedly or is intentionally recycled, You can restart it. When this counter increases unexpectedly, investigate the cause as soon as possible.
-
Worker Process Running
-
The number of worker processes running on the server computer.
ASP. NET Application performance counters
ASP. NET supports the following application performance counters, which can be used to monitor the performance of a single ASP. NET application instance. Each of these counters has a unique instance._ Total __This instance aggregates the counters of all applications on the Web server (similar to the Global counters described in Section 1 of this topic )._ Total __The instance is always available. When no application is available on the server, these counters are displayed as zero.
-
Anonymous Requests
-
The number of requests that use anonymous authentication.
-
Anonymous Requests/Sec
-
The number of requests that use Anonymous Authentication per second.
-
Cache Total Entries
-
The total number of items in the cache. This counter includes both the cache used internally by the ASP. NET page framework and the cache used externally through public APIs.
-
Cache Total Hits
-
The total number of cache hits. This counter includes both the cache used internally by the ASP. NET page framework and the cache used externally through public APIs.
-
Cache Total Misses
-
The number of failed cache requests for each application. This counter includes both the cache used internally by ASP. NET and the cache used externally through public APIs.
-
Cache Total Hit Ratio
-
Cache hit to miss rate. This counter includes both the cache used internally by ASP. NET and the cache used externally through public APIs.
-
Cache Total Turnover Rate
-
The number of cache additions and deletions per second. This helps determine the efficiency of cache usage. The cache cannot be effectively used if the cache is large.
-
Cache API Entries
-
The total number of items in the application cache.
-
Cache API Hits
-
The total number of hits in the cache when the cache is accessed only through the external cache API. This counter does not track the cache used internally by ASP. NET.
-
Cache API Misses
-
Total number of failed cache requests when accessed through an external cache API. This counter does not track the cache used internally by ASP. NET.
-
Cache API Hit Ratio
-
The cache hit-to-miss rate when accessed through the external cache API. This counter does not track the cache used internally by ASP. NET.
-
Cache API Turnover Rate
-
When using external APIs (excluding the cache used internally by the ASP. NET page framework), the number of caches increases or decreases per second. This helps determine the efficiency of cache usage. The cache cannot be effectively used if the cache is large.
-
Compilations Total
-
Total number of compilations that occur during the lifetime of the current Web server process. This happens when files or code with the extension. aspx,. asmx,. ascx, or. ashx are dynamically compiled on the server to hide the source file.
Note:When a request is made to all parts of the application, this value begins to gradually reach the peak. However, during compilation, the generated binary data is saved to the disk (where the data is reused until the source file changes. This means that the counter can remain zero (inactive) even if the process is restarted until the application is modified or redeployed.
-
Debugging Requests
-
The number of requests that occur when debugging is enabled.
-
Errors During Preprocessing
-
Number of errors during analysis. Does not include compilation and runtime errors.
-
Errors During Compilation
-
Number of errors during dynamic compilation. Does not include analysis programs and runtime errors.
-
Errors During Execution
-
The total number of errors that occur during HTTP request execution. Does not include analysis programs and compilation errors.
-
Errors Unhandled During Execution
-
Total number of unprocessed errors that occurred during HTTP request execution.
Note:Unprocessed errors refer to any uncaptured runtime exceptions. They convert user code on the page and enter the internal error handling logic of ASP. NET. This rule has exceptions in the following situations:
- Custom errors and/or custom error pages are enabled.
- Defined in user codePage_ErrorEvent and the error is cleared (UseHttpServerUtility. ClearErrorMethod) or execute redirection.
-
Errors Unhandled During Execution/Sec
-
Number of unprocessed exceptions per second during HTTP request execution.
-
Errors Total
-
The total number of errors that occur during HTTP request execution. Includes any analysis program, compilation, or runtime errors. This counter is
Errors During Compilation,
Errors During PreprocessingAnd
Errors During ExecutionThe total number of counters. Normal Web servers should not generate errors. If errors occur in ASP. NET Web applications, they may distort the throughput results due to different error recovery code paths. Investigate and fix any errors in the application before debugging.
-
Errors Total/Sec
-
Number of errors per second during HTTP request execution. Includes any analysis program, compilation, or runtime errors.
-
Output Cache Entries
-
Total number of items in the output cache.
-
Output Cache Hits
-
Total number of requests processed from the output cache.
-
Output Cache Misses
-
The number of output cache requests failed for each application.
-
Output Cache Hit Ratio
-
Percentage of all requests processed from the output cache.
-
Output Cache Turnover Rate
-
The number of output caches that increase or decrease per second. The cache cannot be effectively used if the cache is large.
-
Pipeline Instance Count
-
Specifies the number of active request pipeline instances for ASP. NET applications. Because only one execution thread can be run in the pipeline instance, this value provides the maximum number of concurrent requests processed for an application. In most cases, it is best to control this value very low when there is a load, which indicates a high CPU usage.
-
Request Bytes In Total
-
The total size (in bytes) of all requests ).
-
Request Bytes Out Total
-
The total size (in bytes) of the response sent to the client ). This does not include standard HTTP response headers.
-
Requests Executing
-
Number of currently executed requests.
-
Requests Failed
-
The total number of failed requests. This counter is added if any or all status code is greater than or equal to 400.
Note:As a result, the 401 Status Code request adds this counter andRequests Not AuthorizedCounter. This counter andRequests Not FoundCounter. As a result, the 500 Status Code request adds this counter andRequests Timed OutCounter.
Note:When a request is rejected (the request cannot be completed because the request is rejected by IIS rather than the process model), the equivalent ASP counter is also added.
-
Requests Not Found
-
Number of requests failed because the resource is not found (Status Code 404, 414 ).
-
Requests Not Authorized
-
Number of requests failed due to no authorization (Status Code 401 ).
-
Requests Succeeded
-
Number of successfully executed requests (Status Code 200 ).
-
Requests Timed Out
-
Number of times-out requests (status code 500 ).
-
Requests Total
-
The total number of requests after the service is started.
-
Requests/Sec
-
The number of requests executed per second. It indicates the current throughput of the application. Under a constant load, this value should be within a specific range (excluding other server work, such as garbage collection, cache cleanup threads, and external server tools ).
-
Sessions Active
-
The number of active sessions. This counter is only supported by the session Status in the memory.
-
Sessions Abandoned
-
The number of sessions that have been explicitly abandoned. This counter is only supported by the session Status in the memory.
-
Sessions Timed Out
-
Number of sessions that have timed out. This counter is only supported by the session Status in the memory.
-
Sessions Total
-
Number of sessions that have timed out. This counter is only supported by the session Status in the memory.
-
Transactions Aborted
-
The number of aborted transactions.
-
Transactions Committed
-
The number of committed transactions.
-
Transactions Pending
-
Number of transactions in progress.
-
Transactions Total
-
The total number of transactions after the service is started.
-
Transactions/Sec
-
The number of transactions started per second.