[SOLVED] Debugging ASP.NET MVC Site Performance Issues

Issue

I have an ASP.NET MVC application, which seems to run OK on my machine, but not when it runs on the server. Does anyone have any tips on finding out where the performance bottleneck may by or any general tips? Would routing misconfiguration ever slow down an application?

I have added HttpContext.Current.Trace.Write statements throughout the code, but they don’t show in the application trace log (/trace.axd)? How can you write to this? I want to be able to see what parts might be slow when the application is being used, without having to have page trace enabled. When page trace is enabled, it writes out information for every partial view that may be used.

A third party library (MvcSiteMap) I am using might be the issue, but can’t really be sure since it is not too bad performance wise on my local PC and I can’t debug the code directly on the server. The application doesn’t hang, it just takes several minutes for the page to load.

Solution

You need to understand where the website is spending its time. For us to help you, we’re going to need some indication of where the problem is (database, partial views, etc.) and some code to look at.

Here are some resources for you:

http://www.slideshare.net/rudib/aspnet-mvc-performance (gets better later on in the presentation)

http://devlicio.us/blogs/hadi_hariri/archive/2010/03/09/profiling-apps-1-of-n-the-mvc-actionlink.aspx

Grab a ten day free trial of this:

http://www.jetbrains.com/profiler/

Here are some links to get you going (remember that MVC is built on top of Asp.Net):

Link

http://msdn.microsoft.com/en-us/library/ms178643(v=VS.100).aspx

http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx

http://www.red-gate.com/supportcenter/Content.aspx?p=ANTS%20Performance%20Profiler&c=ANTS_Performance_Profiler/help/6.1/app_aspnet.htm&toc=ANTS_Performance_Profiler/help/6.1/toc1253710.htm

Answered By – rboarman

Answer Checked By – David Marino (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *