Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I profile an ASP.NET application running on a production server?

I have an ASP.NET application that is consistently using 75% - 100% of the CPU on a production server. How can I profile the application to figure out what part of the code is using up the most CPU? I have looked at a couple of different tools (Xte Profiler, EQATEC, dotTrace), but they all seem to want you to load and run the application within their tool. It seems to me that they want you to load up the application in their tool and run tests locally (not in production). I want to profile the application while it is running in production with people hitting it to see what is actually going on. Is this possible?

I am a newbie to application profiling so forgive me if I have missed something obvious or am not thinking about this correctly.

Thanks, Corey

like image 672
Corey Burnett Avatar asked Feb 03 '23 01:02

Corey Burnett


1 Answers

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

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

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

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

The great thing about this tool (besides "no-install required" portability, cmd-line interface, etc etc) is that APM packages like NewRelic etc only monitor http-requests. If your app has some background threads - they won't help much.

like image 141
Serge Shultz Avatar answered Feb 16 '23 13:02

Serge Shultz