Monitoring Application Pool Performance: Key Metrics And Methods

how to monitor application pool performance monitor

Monitoring application pool performance is crucial to ensure your website or application is running smoothly and efficiently. By tracking relevant metrics, you can identify potential issues and optimize performance, enhancing the user experience. This process involves using tools and techniques to gather insights into how your application is functioning, allowing you to take proactive measures to maintain high performance. This includes monitoring memory usage, CPU usage, request handling, and more, with the help of performance counters and application performance management systems.

Characteristics Values
Performance Monitor Location Start -> Run -> perfmon
Monitor Type Process Monitor - WMI
Performance Counters CPU %, Memory, Web Service: Bytes Received/Sec, Web Service: Bytes Sent/Sec, Web Service: Current Connections, ASP.NET Applications: Requests/Sec, ASP.NET Applications: Requests in Application Queue, .NET CLR Memory: % Time in GC, .NET CLR Exceptions: # of Exceptions Thrown, ASP.NET Applications: Errors Unhandled During Execution/sec, ASP.NET Applications: Errors Total/Sec
Application Pool Monitoring Monitor via IIS's status and not just the presence of w3wp.exe

shundigital

Monitor IIS application pools with SolarWinds SAM

SolarWinds Server & Application Monitor (SAM) is a tool that can be used to monitor IIS application pools. SAM can monitor five instances (e.g. w3wp.exe) separately, as long as the application pool names are specified in the component monitors.

To set up SAM to monitor IIS application pools, first, add the web server to the SolarWinds Platform database. Then, find the w3wp.exe process on the web server. Next, set up the component monitors. Finally, set up the application monitor.

Step 1: Add the Web Server to the SolarWinds Platform Database

  • Click "Settings" and then "All Settings."
  • Click "Add Node" and enter the hostname or IP address of the Intranet web server.
  • Check the "ICMP (Ping only)" checkbox and click "Next."
  • From the "Add Application Monitors" page, click "Next."
  • From the "Change Properties" page, click "OK, Add Node."

Step 2: Find the w3wp.exe Process on the Web Server

  • In the SolarWinds Platform Web Console, click "Settings" > "All Settings" > "SAM Settings" > "Component Monitor Wizard."
  • Select "Process Monitor - WMI" as the monitor type and click "Next."
  • Click "Browse," select the web server, and then click "Select."
  • Enter "WebServerAdmin" in the "Credential Name" field and enter your credentials.
  • Click "Next."
  • On the last page, check the checkbox next to "w3wp.exe" and click "Next."

Step 3: Set Up the Component Monitors

  • Change the "Monitor Name" to "Webpool1" and enter "webpool1" in the "Command Line Filter" field.
  • Change the "CPU Warning Threshold" to greater than 40 and the "CPU Critical Threshold" to greater than 50.
  • Click "Add Another Component." Repeat the above steps for all five w3wp.exe instances and then click "Next."

Step 4: Set Up the Application Monitor

  • Select "New Application Monitor" and enter "Web Server Application Pools" as the Application Monitor Name.
  • Click "Next," select the web server node, and then click "Next" again.
  • Finally, click "OK, Create."

Tips for Using AppInsight for IIS

  • You can disable dynamic AppInsight for IIS components if a known issue in your environment (e.g. a web server outage) will increase false-positive alerts and logs.
  • Turn off components that aren't important for your organisation to reduce polling loads.
  • For advanced managing of IIS sites, disable unused sites instead of deleting them. To reduce alert noise, disable any alerts associated with those disabled sites.
  • Enable sites through the Site Details pages in AppInsight for IIS. This option and others are available in the Management widget per ISS server, site, and application pool.

shundigital

Monitor IIS worker process using Windows Performance Monitor

The Windows Performance Monitor is a useful tool for monitoring IIS worker processes. It provides hundreds of metrics that can be used to monitor the performance of your application. To access it, go to Start -> Run -> perfmon, then select 'Performance Monitor' in the left pane and click the '+' button to add counters.

If you are using an ASP.NET-based website, you can select one of the 'ASP.NET Apps' counter categories and choose the 'Managed Memory Used' counter. This will allow you to monitor the memory usage of your website in real-time or save the data for later analysis.

You can also examine specific metrics for app pools using the W3SVC_W3WP counter category. However, there is no option to view memory usage per app pool.

For a basic check to ensure your application is running, you can set up a simple HTTP test that runs every minute. This will give you a baseline to know if your site is up or down and help you track response times.

Additionally, it is important to always monitor the status of your IIS Application Pool, as it can sometimes crash or stop unexpectedly. Most monitoring tools, such as Retrace, can monitor IIS Application Pools by default.

Some recommended Performance Counters for IIS Monitoring include:

  • System/Process Counters: Monitor CPU % and memory usage for your IIS Worker Process.
  • Web Service: Track Bytes Received/Sec and Bytes Sent/Sec to identify potential spikes in traffic, and Current Connections to establish a normal value based on your experience with the app.
  • ASP.NET Performance Counters: Monitor Requests/Sec and Requests in Application Queue. If the number of requests in the queue is high, your server may not be able to keep up.
  • .NET CLR Memory: Ensure your app is spending less than 5% of its time on garbage collection; otherwise, review how object allocations are performed.
  • ASP.NET Error Rate Counters: Monitor .NET CLR Exceptions and ASP.NET Application Errors to identify any hidden performance problems.

shundigital

Use appcmd to monitor the app pool

The AppCmd tool is a powerful command-line tool for publishing or hosting a website on IIS. It can be used to host static and dynamic websites, such as ASP.NET Webform, MVC, and Dot Net Core. The AppCmd tool can be found at c:\Windows\System32\inetsrv on a web server.

To use AppCmd to monitor the app pool, you can start by listing all the available commands and actions. Open Command Prompt as an administrator and run the following command:

AppCmd

Or

AppCmd /

To list all the app pools on your IIS server, use the following command:

Appcmd list apppool

You can also use AppCmd to start and stop websites. For example, to start a website, use the following command:

Appcmd start site "yourwebsite.com"

To stop a website, use the following command:

Appcmd stop site "yourwebsite.com"

AppCmd can also be used to enable or disable anonymous authentication and Windows authentication for a website. To enable anonymous authentication, use the following command:

Appcmd set config "yourwebsite.com" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"True" /commit:yourapppool

To disable anonymous authentication, set "True" to "False" in the above command.

Similarly, to enable Windows authentication, use the following command:

Appcmd set config "yourwebsite.com" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:yourapppool

You can also use AppCmd to change Windows authentication providers, add custom headers, add default documents, backup and restore IIS settings, and more.

Additionally, AppCmd can be used to monitor the status of IIS application pools. For example, to check if any application pools are stopped, you can use the following command:

Appcmd list apppool /state:"Stopped"

This command will return a list of sites that are not in a "started" state, allowing you to monitor and manage the status of your application pools.

shundigital

Performance counters by Application Pool and ASP.NET Apps

Performance counters are a great feature of ASP.NET, offering a wide array of metrics available between IIS, ASP.NET, and .NET.

Processor – % Processor Time:

This tracks the overall CPU usage of the entire server.

Memory – Available MBytes:

This shows the number of megabytes in memory not being used.

Note: this is where it gets tricky. You have to know the process name of your counter. It is likely w3wp, w3wp#1, etc.

Process – % Processor Time:

This tracks the CPU used for just your application pool.

Process – Working Set – Private:

This tracks the memory being used by your IIS application pool.

Note: For these counters, you need to know the instance name of your application. They should be something like _LM_W3SVC_1_ROOT_AppName.

ASP.NET Applications – % Managed Processor Time (estimated):

This allows you to get the estimated CPU time for your specific application, and not the entire IIS application pool, which could include multiple applications.

ASP.NET Applications – Managed Memory Used (estimated):

This allows you to get the estimated memory usage for your specific application, rather than the entire IIS application pool.

Web Traffic Counters:

There are several different counters that are helpful to track how much traffic your web application is getting.

ASP.NET Applications – Requests/Sec:

It is a good idea to monitor how many requests are handled by both IIS and ASP.NET. Some requests, for example, static files, may only be processed by IIS and never touch ASP.NET.

Web Service – Bytes Received/Sec:

This helps to identify potential spikes in incoming traffic data.

Web Service – Bytes Sent/Sec:

This helps to identify potential spikes in outgoing traffic data.

Web Service – Current Connections:

Tracking this metric will help you establish what is normal for your application and help identify spikes.

ASP.NET Applications – Requests in Application Queue:

If this number is too high, your server may not be able to handle requests fast enough.

Exception & Error Rate Counters:

It is common for an application to have high exception rates that go unnoticed. By tracking these counters, you can get visibility into these types of problems.

NET CLR Exceptions – # of Exceps Thrown:

This tracks all .NET exceptions that are thrown even if they are handled and thrown away. High rates of exceptions can cause hidden performance problems.

ASP.NET Applications – Errors Unhandled During Execution/sec:

This shows how many exceptions were unhandled and may have been visible to your users.

ASP.NET Applications – Errors Total/Sec:

This shows the number of errors during compilations, pre-processing, and execution. This may catch some types of errors that other exception counts don’t include.

Garbage Collection Counters:

The number of collections is useful if you are having problems with garbage collection and need to track how often it is occurring.

NET CLR Memory – % Time in GC:

If your app spends more than 5% of its time in garbage collection, you may want to review how object allocations are performed.

NET CLR Memory – # Gen 0 Collections:

This shows the number of times that garbage collection has occurred for generation 0 objects.

NET CLR Memory – # Gen 1 Collections:

This shows the number of times that garbage collection has occurred for generation 1 objects.

NET CLR Memory – # Gen 2 Collections:

This shows the number of times that garbage collection has occurred for generation 2 objects.

shundigital

Performance counters are a great way to monitor IIS performance and ensure your site is running optimally. Here are some recommended performance counters for IIS monitoring:

System/Process Counters

  • CPU %: Monitor the overall server and CPU usage for your IIS Worker Process. Ensure it doesn't exceed 80% as it may result in performance issues.
  • Memory: Track the currently used and available memory for your IIS Worker Process. Aim to keep at least 50% of the memory available to maintain system health.

IIS Performance Counters

  • Web Service (Bytes Received/Sec and Bytes Sent/Sec): Monitor the bytes received and sent per second to detect possible web traffic spikes.
  • Web Service (Current Connections): There is no specific normal value for current connections. Specify a value based on your experience with the apps.

ASP.NET Performance Counters

  • ASP.NET Applications (Requests/Sec and Requests in Application Queue): Monitor the requests dealt with by both IIS and ASP.NET. Keep an eye on the requests in the application queue to ensure the server can handle requests efficiently.
  • .NET CLR Memory (% Time in GC): Optimally, your app should spend less than 5% of its time in garbage collection. If it exceeds this, review how object allocations are performed.

ASP.NET Error Rate Counters

  • .NET CLR Exceptions (# of Exceptions Thrown): Track all .NET exceptions, even those that are thrown away. A high rate of exceptions can cause hidden performance issues.
  • ASP.NET Applications (Errors Unhandled During Execution/Sec): Monitor the number of exceptions that haven't been handled and may have impacted your users.
  • ASP.NET Applications (Errors Total/Sec): Track the number of errors during compilations, pre-processing, and execution. This can help catch errors that other exception counts might miss.

Frequently asked questions

To access the Windows Performance Monitor, simply do Start -> Run -> perfmon. From there, select 'Performance Monitor' in the left pane, and click the '+' button to begin adding in counters.

Most monitoring tools have a way to monitor IIS Application Pools. For example, Retrace monitors them by default. You can also use appcmd to monitor the app pool.

If your application is ASP.NET-based, you can select one of the 'ASP.NET Apps' counter categories and click on the 'Managed Memory Used' counter.

One of the recommended performance counters for IIS monitoring is CPU %. This will allow you to monitor the overall server and CPU usage for your IIS Worker Process.

One of the recommended performance counters for ASP.NET monitoring is 'ASP.NET Applications: Requests/Sec'. This will allow you to track how many requests are handled by both IIS and ASP.NET.

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment