How to monitor or profile a slow .Net Web Application
Can anyone tell me how to go about determining the culprit on a slow running process. I have a page that queries an Active Directory and a SharePoint Server to get information. It makes several calls to each Server (retrieving customer infor开发者_运维知识库mation). I am wondering if there are any tools available to profile a web application looking for this type of information, slow running methods, etc.
Thanks for any tips given...
Try setting Trace="true" for Page like this
<%@ Page ... Trace="true" ... %>
and it will generate trace info at the bottom of the page like this
And here's an MSDN post related to that.
Without any tool, start by surrounding "interesting" methods calls with Stopwatch. Log the results somewhere ( I suppose you already have a log enabled ) and you probably will discover the performance pitfall. If this fails, follow the Oded reply ;)
Attach a profiler to the process.
There are several commercial ones - dotTrace, ANTS, memprofiler and others.
These will give you statistics regarding where time is spent, what functions were called most etc...
See this SO thread with recommendations.
Update:
This will supplant the information that trace="true"
will give (as answered by @Bala) and give you more detail (for example, if you are calling both AD and SharePoint in PageLoad, you are no closer to an answer).
I recommend YourKit over some of the others. An I believe there is a free trial
http://www.yourkit.com/
精彩评论