开发者

How to monitor or profile a slow .Net Web Application

开发者 https://www.devze.com 2023-02-22 13:15 出处:网络
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

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

How to monitor or profile a slow .Net Web Application

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号