The counters listed in this section include the most important counters for performance and workload characterization. They do not include counters that are not compatible with IIS 6.0. Note: When monitoring .NET Web-based applications it is recommended to monitor .NET CLR as well. For a list of important counters for .NET CLR monitors, see Chapter 7, “.NET Platform Monitoring.”
The Web Service counters help you determine how well the World Wide Web Publishing Service (WWW service) processes requests. The WWW service is a user-mode service. These counters also reflect the processing that occurs in the kernel-mode driver, HTTP.sys. You can configure these counters either per Web site or globally for the entire server by selecting the _Total instance.
- Bytes Sent/sec – The rate, in seconds, at which data bytes have been sent by the WWW service
- Bytes Received/sec – The rate, in seconds, at which data bytes have been received by the WWW service
- Current Connections service – The number of active connections to the WWW
- Not Found Errors/sec – The rate, in seconds, at which requests were not satisfied by the server because the requested document was not found
- Locked Errors/sec – The rate, in seconds, at which requests were not satisfied because the requested document was locked
- Current ISAPI Extension Requests – The number of ISAPI extension requests that are being processed simultaneously by the WWW service
- ISAPI Extension Requests/sec – The rate, in seconds, at which ISAPI extension requests are being processed by the WWW service
WWW Service Cache
The WWW service and FTP service do not share a common cache. Instead, the caches are split into two separate performance objects: one for FTP service and one for the WWW service. WWW service cache counters are designed to monitor server performance only; therefore, you cannot configure them to monitor individual sites
- Current File Cache Memory Usage – The number of bytes currently used for the usermode file cache
- Current Files Cached – The number of files whose content is currently in the user-mode cache
- Current URIs Cached – The number of URI information blocks that are currently stored in the user-mode cache
- Current Metadata Cached – The current number of metadata information blocks in the user-mode cache Kernel: URI Cache Hits/sec – The average number of kernel URI cache hits that are being made per second
ASP.NET supports the following ASP.NET system performance counters, which aggregate information for all ASP.NET applications on a Web server computer, or, alternatively, apply generally to a system of ASP.NET servers running the same applications. Note: Not all of these counters are available in all IIS deployments.
- Requests Disconnected – The number of requests that were disconnected because a communication failure occurred.
- Requests Queued – The number of requests in the queue waiting to be serviced. If this number increases as the number of client requests increases, the Web server has reached the limit of concurrent requests that it can process.
- The default maximum for this counter is 5,000 requests. You can change this setting in the computer’s Machine.config file.
- Requests Rejected – The total number of requests that were not executed because insufficient server resources existed to process them. This counter represents the number of requests that return a 503 HTTP status code, which indicates that the server is too busy.
- Errors Total/sec – The average number of errors that occurred per second during the execution of HTTP requests. Includes any parser, compilation, or run-time errors.
- Output Cache Turnover Rate – The average number of additions to and removals from the output cache per second. If the turnover is great, the cache is not being used effectively.
- Sessions Active – The number of sessions that are active. This counter is supported only with in-memory session state.
- Transactions/sec – The average number of transactions that were started per second.
- Transactions Pending – The number of transactions that are in progress.
Active Server Pages
If you are running Active Server Pages (ASP) on your server, the ASP counters can help you determine how well the server or site is responding to ASP requests. The ASP counters are designed to monitor server performance; you cannot monitor individual ASP applications because ASP counters collect global data across the entire WWW service.
- Errors/sec – The average number of errors that occurred per second.
- Requests/sec – The average number of requests that were executed per second.
- Requests Executing – The number of ASP requests currently executing (for example, the number of active worker threads).
- Requests Queued – The number of queued ASP requests that are waiting to be processed. The maximum number for this
- counter is determined by the metabase property AspRequestQueueMax.
- Transactions/sec – The average number of transactions that have been started, per second.
Optimization and Tuning
When performance issues are encountered, tuning and optimization are required to alleviate these issues. In most cases application code optimization is required, but sometimes fixing a poorly tuned environment can dramatically improve performance.
This section lists some possible tuning practices. Some are oriented for the IIS Web server while others are general for any Web server. There are many other tuning practices that might be more effective for your application. Tuning requires a long and iterative process of testing and analysis. Any configuration change requires careful validation. Before applying any of below practices, you should first validate the relevancy of the configuration to your specific application by understanding the parameter and the workload generated against your server.
- Tune the connection limit. A large number of connections alongside high CPU utilization and high processor queue length indicates a CPU bottleneck. You should either limit maximum connections allowed or increase CPU power.
- Turn off ASP debugging. Verify that both the server and client sides are turned off by setting AppAllowDebugging and AppAllowClientDebug to false.
- Set AspBufferingOn to true in order to collect the ASP output buffer before it is sent to the client.
- The AspProcessorThreadMax Metabase property specifies the maximum number of worker threads per processor that IIS can create. To find out the maximum number of worker threads that IIS allows per ASP process, multiply this value by the number of processors on your server. If you decrease this value, monitor performance to make sure that the lower thread limit does not degrade performance. If it does, increase the value again.
- The AspRequestQueueMax Metabase property specifies the maximum number of ASP requests that are permitted in a queue. The default value is 3,000, but the optimal setting depends on the behavior of the application. If the execution time of the request is very short and the time in the queue is short, it is reasonable to decrease this value.
- Verify that the keep-alive state for each TCP connection is enabled (connection = keep-alive). If keep-alive connections are turned off, every file requires a new TCP connection. For small files, enabling HTTP Keep- Alives in IIS effectively doubles the number of roundtrips.
- Enable HTTP compression to increase efficiency of bandwidth use.
- Set HTTP expire headers for all images and for HTML so that proxy servers and browsers make fewer calls to the Web server.
- Remove unnecessary file content. Remove unnecessary empty lines, tabs, characters, and so on. Bigger files impact the time it takes to transfer a file over the network.
- Use static files wherever possible in order to reduce processor demand as much as possible.
- Establish Web gardens, which are application pools that can run multiple worker processes.