Search code examples
asp.netmemory-managementloadcpu-usageperfmon

How to monitor the computer's cpu, memory, and disk usage in ASP.NET?


I would like to monitor the following system information in my ASP.NET solution:

  • current cpu usage (percent)
  • available memory* (free/total)
  • available disk space (free/total)

*note that I mean overall memory available to the whole system

I tried with windows perfmon (run --> perfmon.msc ) but it seems not to be what I'm searching for. I need something that can tell me the resources load for every function or method called into my application.

Any suggestions are much appreciated.

EDIT: Maybe it could be useful to know how to monitor, with perfmon, the % Process Time cosumed by a single process (for istance w3wp)

EDIT EDIT: I found it! Add new counter --> Process --> % Processor Time on w3wp! THANKS


Solution

  • Perfomance counters is my advice. Check out Setting up performance counters for ASP.NET

    Beyond performance counters, if you really want to get an 'inside' look at your code, then you can try a memory profiler, such as the following: