diagnosing performance of asp.net website / application pool

余生长醉 提交于 2019-12-06 08:33:18

DebugDiag is a great place to start: http://www.microsoft.com/download/en/details.aspx?id=26798

Start using Performance Counters on the server. Add the counters for Garbage Collection, Threads usage and see exactly which thread is consuming the CPU.

Also, check out this:

http://weblogs.asp.net/jgalloway/archive/2009/04/09/troubleshooting-an-intermittent-net-high-cpu-problem.aspx

I had a same issue in Past. I mainly had problems with HTML rendering very slow . I resolved it by setting the Trace = true in page directive and found out the event which were taking time.

Another issue was the Memory Management. I was using Image Classes and did not Dispose them properly. For that I started to use Dispose() method and I can have Using statements in the architecture.

using (SqlConnection con = new SqlConnection("Connection String"))
{
    using (SqlCommand cmd = new SqlCommand())
    {
        using (SqlDataReader DR = cmd.ExecuteReader())
        {

        }
        using (DataTable DT = new DataTable())
        {
        }
    }
}

I assume you may have any page where you may be fetching records in excess. You can start to use Paging.

The most important point is Exception Handling. Try Catch block should not be in every layer. It should be in Presentation Layer only. Reason being, when exception occurs, it goes back to the calling function directly. So why to write Try Catch block and thus stopping the execution in each layer

Far the best and easiest starting point is to use performance profiler. Just run it and with a bit of luck you'll have problem fixed in minutes.

Try dotTrace, it's a quite good one. If you follow the link, there is 10 days free trial and video tutorial.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!