Profilers and ASP.NET


There are a lot of different ways to troubleshoot ASP.NET issues.  I have gone over most of the things you can do with a dump that has been captured from the process.  But there is another way to get useful information out of a process and that is by using a profiler.

There are a number of profilers that are available for .NET applications.  Some of the more popular ones include (most come from Brads post and there is a good list here as well):

Traditional Performance and/or Memory Profilers

Enterprise Health Monitors

The drawback with any of these profilers is that it has to be enabled prior to the process starting up.  So it is very difficult to use these to analyze a web server.

Note: SciTech has the following on their website (but I haven’t actually tested it out) – A wizard is also provided for connecting the profiler to already running processes, or to import memory dump files. This is especially useful when profiling problems in a production application.

With .NET 4.0, this will change as profilers are allowed to attach to a running process.  This will make profiling much better when dealing with ASP.NET.  Check out David’s blog for more info on that.

I have used some of these and have had my own experiences with them but I really want to hear what you guys think.

Some questions I have for you guys in regards to profilers:

  1. Do you use a profiler against your code?
  2. Which profiler(s) have you used?
  3. How much success do you have with it?
  4. Are you thinking of using a profiler to help track down any issues?
  5. What features do you think would be really useful for a profiler to have?
  6. What drawbacks keeps you from using a profiler?
  7. Would you consider running a type of profiler against your application in development if it helped you to get a better idea of performance or potential issues with your code?
Comments (8)

  1. profiler says:

    Don’t forget the Visual Studio Profiler, which works well with .NET 4.0 including in the attach case where you don’t need to restart your server.

    Colin

  2. Søren Skov says:

    Unfortunately attaching a profiler does not give the profilers many profiling options – at best you can create object graphs. So the issue of profilers and being there at startup still persists.  

  3. Colin Bowern says:

    1. Yes

    2. I use Red-Gate’s ANTS profilers, I have also used YourKit’s .NET Profiler (www.yourkit.com)

    3. Pretty go

    4. Yes, all the time.

    5. Quickly identify hot paths, taking snapshots

    6. Clunky setup – not as easy as hitting F5 to debug through code

    7. Yes, but it has to be fast and easy to integrate – not require me to elevate to admin all the time (I loathe developing as admin)

  4. Hi Tom,

    I have used Mercury products a lot for automating functional testing and performing huge scale load testing. But they are not Mercury anymore, they were sold out to HP about two or three years ago:

    "Products and services formerly marketed under the Mercury Interactive name have been integrated into the HP IT management portfolio and rebranded.   Although the names of these offerings have changed, the product architecture and functionality remain intact."

    Regards,

    Carlos Figueroa

    @carlosfigueroa

  5. tomchris says:

    Yourkit looks very interesting, I haven’t seen that one before now.

    And thanks to everyone for the feedback.

  6. paper1337 says:

    We have used the EQATEC Profiler a few times to identify some performance problems with an internal ASP.NET application. It is free and easy to use – definitely worth checking out.

    http://www.eqatec.com/tools/profiler

  7. Mias Van Den Berg says:

    I recently came accross the Asp.Net Web Profiler. It is really handy when looking at what goes on in your web application memory. It shows an entire break down of the cache, application state and all active sessions. It shows all the sizes of everything in memory and has some drill down functionality to explore all the data and its properties. You can download it from [http://www.aspwebprofiler.com][1].

    Hope this helps.

  8. Mias Van Den Berg says:

    I use the asp.net web profiler. Shows all data used by the server with sizes for all sesisons as well.

    http://www.aspwebprofiler.com