4
votes

Knowing and using .NET memory and performance profilers (like e.g. RedGate's ANTS Profiler) very well in my development environment, I still found no real way to do it on a production server.

Currently I'm experiencing every now and then 100% CPU usage of w3wp.exe for a certain application pool.

Looking at various performance counters, I'm still unable to determine the real cause, since I cannot determine in which part of my code the high CPU utilization takes place.

I've tried CLR Profiler on the live server (with no meaningful result) and I even could imagine installing ANTS Profiler and let it run for hours to get some measurement logs.

Just to be sure I'm doing it right, my question is:

What is the best way to do some ad hoc measurements on a production IIS 7 web server to detect code bottlenecks?

4
More specific metric counters might be interesting. For example, do you see a spike in "%Time in GC" or "% Time in Jit" that coinside with the CPU spikes? - vcsjones
@vcsjones Thank you. Even if I have these information, I'm totally clueless how I would ever be able to map them to source code lines so that I could improve the source code. - Uwe Keim
I've just found LeanSentry which sounds like a good tool, although I did not try it yet and it seems kind of "dead" (last blog entry from over a year ago and pricing table says "© 2013" together with some "coming soon"s). - Uwe Keim
@UweKeim what solution did you end up with? I'm seeing cpu spikes with my asp.net app, and not sure where to start... Tried New Relic - no useful data there :( - Serge Shultz

4 Answers

2
votes

Although you've answered your own question, I just wanted to mention Gibraltar.

I haven't used it myself, but I've heard good things about it.

1
votes

Having asked the question also in the Red Gate's ANTS Profiler forum, I got a great reply from the developers:

Basically the pointed me to the Early Access Program (EAP) version of version 7 of ANTS Profiler. This one has a feature that they call "continuous profiling" which basically does a live trace of a IIS worker process.

I'll give this tool a try since it seems to be exactly what I want to have.

1
votes

I'd be tempted to adopt something line New Relic's APM product - will allow you to monitor both the real user experience (page load times), servers and the application itself

Have a look at this for more details: http://newrelic.com/docs/dotnet/new-relic-for-net

1
votes

Sam Saffron (one of the StackoverFlow creators) has created a great command-line tool a while ago, but unfortunately has abandoned it.

A friend of mine has forked the code to make it work in 2015:

https://github.com/jitbit/cpu-analyzer

(the page has a link to Sam's blog post explaining how to use it)