views:

287

answers:

7

We have MSSQL, some C# web services, some ASP.NET, and some AJAX. We're having terrible load times, normally 2-3 seconds to refresh a page, sometimes far more. I have no idea where to start.

What profiling tools are there, across the entire end-to-end, to identify where the biggest bottlenecks are?

+3  A: 

Your best bet...as I've said a million times before...is the Red Gate set of tools.

ANTS Performance Profiler is the tool for you.

For SQL Profiling, you can always use the built in Profiler that comes with SQL Server.

Justin Niessner
Absolutely, used this and was able to find bottlenecks in code that I would have never suspected being a bottleneck. Such as Strongly typed datasets.
Zoidberg
Shameless plug: I did a blog post last year discussing my ASP.Net optimization toolbox. I recommended Ants as well for a profiler, and they've improved it significantly since then. Dottrace is also great. Here's the post: http://www.phpvs.net/2008/08/11/aspnet-load-testing-and-optimization-toolkit-so-you-want-to-be-a-hero/
womp
+2  A: 

If you only need to do this once, or you don't have enough money for whatever profilers you may find, you can always resort to tracing.

In the C# code that pulls back results from a web service or database call, wrap the call with code to detect how long the call takes. Write that to some log file, debug output, or straight into the resulting page. Do similar things for other situations that appear suspicious.

John Fisher
+2  A: 

Does the system only behave poorly in one environment, i.e. with a larger dataset than what you develop against? That has been a problem for us a lot in the past b/c people will write bad queries against small sets of data but never notice until we hit production.

If not then I'm sure folks will recommend lots of good tools such as SQL Profiler, Visual Studio's Profiler, or simply using Trace=true on your ASP .Net pages. For AJAX I find a JavaScript debugger like Firebug useful for seeing what's going on behind the scenes.

David Peters
+1 for ASP.NET tracing. If you have some logging or tracing statements around databinding items, that may help. One time I discovered that the data retrieval wasn't the bottleneck, it was the fact that it was binding 5000 records to a drop down list. So the database query was optimized to reduce the number of items being bound.
Dillie-O
+1  A: 

Jetbrains has a product called dotTrace which monitors performance as well as memory.

Joseph
+1  A: 

Probably the best first step is to determine whether it is the database that is taking the time or the front end.

Red Gate tools can also be useful, although if you're not sure what they're telling you to fix, you may want to start at a more basic level. If it's the database, then SQL Server profiler is your friend. A few basic traces in there, paying particular attention to duration and reads will point you in the right direction, or at least help you identify the problem areas.

On the web side, the trace flags can be particularly useful.

Good luck! Dan

Dan
A: 

Google Page Speed - a Firebug plugin - may also be an option to trace what consumes your time when loading the ASPX pages.

Btw, often also a huge ViewState may be an issue on Aspx pages.

Juri
A: 

More on what @Juri said, also get the YSlow plugin for Firebug.

A few things I go to first to fix speed:

  1. Combine all CSS files into one (and minify)
  2. Combine all Javascript files into one (and minify)
  3. How many images do you have on the page? Consider using Sprites.
  4. Any 404s on the page?

Also, did you try just using Trace="true".

Martin