Last week we talked about how to monitor IIS. Today we’re going to discuss monitoring ASP.NET. We’ll cover a number of things including: the main implications of monitoring ASP.net, the most important performance counters to look for, performance counter values that should be measured and services dependent on ASP.net that should be monitored.
If you haven’t read the last blog post about Monitoring IIS, please take a look at it because it will provide a general idea of how to monitor a Windows web server and will also help you understand better how to monitor ASP.NET. Keep in mind that monitoring IIS and ASP.NET can go hand in hand and many items are similar between both.
So, what exactly is ASP.NET?
ASP.net is a web development platform available in Windows Server. It was built by Microsoft to allow web developers to create web applications that are mainly hosted using IIS. Using ASP.NET developers can create dynamic websites that take advantage of its libraries. By using a programming language such as C# or Visual Basic, the code written in these libraries can be invoked and used in web pages. ASP.net files have the .aspx extension.
The following excerpt from Microsoft’s website best describes ASP.NET in a single phrase: “ASP.net is a free, fully supported Web application framework that helps you create standards-based Web solutions. It provides a rich set of features and easy integration with databases, web services and rich internet applications. With features such as WebForms, MVC, dynamic data scaffolding, an AJAX framework, templates and themes, hundreds of built in controls and free developer tools, ASP.NET will enable you to build Web apps better and faster.”
There are many tools that can help you check your Web application performance, but ASP.NET contains other performance counters that can be monitored.
Also, this web application framework includes a tracing feature in which you can monitor your code and discover any errors related to the executed code.
ASP.NET Performance Counters
When you are monitoring your web applications, in addition to the normal IIS counters, you can also monitor the following performance counters available with ASP.NET:
- ASP.NET\Application Restarts – this is a value that represents the total number of application restarts since the IIS server was last stopped.
- ASP.NET\Applications Running – the total number of ASP.NET applications that are currently running on the web server.
- ASP.NET\Request Execution Time – measures the number of milliseconds taken to execute a request. This counter is important in understanding how your application serves requests. This counter should be monitored carefully because it may indicate that either your app’s code is not efficient or there is a slow performance on your web server which impacts the overall performance of your ASP.NET applications.
- ASP.NET\Requests Rejected – indicates the total number of rejected applications.
- ASP.NET\Requests Queued – the total number of ASP.NET requests that are waiting to be executed.
- ASP.NET\Requests Current – this is the number of requests that are currently managed by the ASP.NET ISAPI. This performance counter will let the application accept requests until the maximum threshold limit is reached. This counter is very helpful in monitoring the total number of requests that impact your application. Any value that is above the number defined in the requestQueueLimit parameter (configured in the processModel) will stop the application from accepting new requests.
- ASP.NET\Worker Process Restarts – this parameter counts the number of times a certain worker process was restarted. Remember that a worker process is instantiated within an application pool and it’s responsible for executing active requests. It is recommended that each web app should have a separate application pool with at least one worker process.
- ASP.NET Applications\Requests/Sec – this value represents the number of ASP.NET requests per second
- ASP.NET Applications\Errors Total – the total number of ASP.NET errors
Preferred Performance Counters
There are so many ASP.NET performance counters that it is hard to find the best combination of perf counters to be monitored, while not impacting your server’s performance or creating a huge list that cannot be monitored by system administrators.
Most technical sources suggest the following performance counters should be monitored with all ASP.NET applications:
- Microsoft® .NET CLR Exceptions\# Exceps thrown / sec
- Memory\Available Mbytes
- Processor(_Total)\% Processor Time
- Process(aspnet_wp)\% Processor Time
- Process(aspnet_wp)\Private Bytes
- Process(aspnet_wp)\Virtual Bytes
- Process(aspnet_wp)\Handle Count
- Web Service\Current Connections
- Web Service\ISAPI Extension Requests/sec
We have already gone over some of these performance counters in the last article, so now let’s focus on some of the new items shown here.
The Microsoft® .NET CLR Exceptions\# Exceps thrown /sec – this counter measures the number of exceptions thrown by your ASP.NET applications. In normal behavior web apps should not throw these exceptions, so keeping an eye on this counter should alert of any abnormal application performance. As the number of thrown exceptions increases, the application’s performance decreases. Your monitoring tool must be configured to alert administrators if this value is more than 5% of the number of requests per second.
Even More Performance Counters!
There are many counters we will not get into, however these are the counters that have a great impact on application performance. Besides ASP.NET counters and application counters, there are others that should be monitored carefully because they indicate the overall resource utilization on your web server:
- Processor counter – %Processor Time% – this counter indicates the percentage of time threads are using system processors. The maximum threshold for this counter is 70%; any value above this limit indicates that either your applications are not performing well or your hardware components should be upgraded. Remember that this counter measures the performance of all processes running on the IIS server.
- Memory counter – Available Mbytes – this counter measures the amount of physical RAM available. If there is less than 20% free of the physical memory, consider replacing some hardware components.
- Process Counters – these are counters that measure the performance of a single process
- %Processor Time% – this is the percentage of CPU resources that a single process is using.
- Private Bytes – committed memory used by a process. An abnormal value can indicate memory leaking. Each worker process is instantiated within a process, so monitor these counters carefully. If the physical memory used by a process is more than 60% and the virtual memory is close to 1.6 GB of a virtual address space of 4 GB, it will start affecting your server’s performance.
- Thread Count – this indicates the number of threads active in a process.
- Handle Count – the number of handles in a process. This should be under 10000.
Any Suggestions for Other Counters to Monitor for ASP.NET?
This should cover most of the important aspects of monitoring ASP.NET. Remember, there are an incredible amount of counters that can be monitored. We hope to have covered the most crucial ones here. However, if you feel there are any we left out that could be very important to others, please feel free to post your thoughts below in our comments section.
Thanks, and stay tuned for our last of this 3 part series, regarding monitoring SQL Server. Cheers!