Richard Florance's Solution Performance blog

Everything and anything about making Solutions run faster and more efficiently...

Easy wins tuning the performance of a web site

I've been on several ASP.Net web site projects over the last couple of yeras doing performance analysis and I've found that every time there is a common series of quick wins I've been able to make that can have a substantial effect on the responsiveness and scalability of web sites. It's now got to the point where I've written a list of things that I want the solution development team to check before I'll come and do any deeper analysis on the project. Here is the core list of work items I've come up with that you should look at first when tuning ASP.Net web sites:

 

·         Turn on IIS Compression (this is off by default on IIS6 and IIS7). See here on how to do this:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d52ff289-94d3-4085-bc4e-24eb4f312e0e.mspx?mfr=true

·         Turn on IIS content Expiry (again this is off by default). See here:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true

·         Merge static content into as few files as possible (e.g. only have one .js file and .css file). It is faster to download one big file that several smaller ones over the internet.

·         Enable ASP.Net output caching where possible. You need to look at this on a page by page basis but can give huge wins for pages that contain mostly static content. See here: http://support.microsoft.com/kb/323290

·         Enable Web service output caching where possible. If you have any public web services that only return a limited or predictable range of values based on their input parameters you should look at this. See Here: http://support.microsoft.com/kb/318299

·         If your Site makes web service calls, increase MaxConnections in the Machine.config to handle the level of concurrency you want to support. See: "Threading Explained" here:  http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8. However don't take this as an absolute rule. For MaxConnections it is OK to go higher if your middle tier makes lots of long running Web service calls.

·         Change the IIS threading configuration in machine.config to support better scaling. See: "Threading Explained" here:  http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8

·         Ensure ViewState is turned off where possible, and then only enable it for the controls that really need it. Viewstate can be huge and is on by default. turning off ViewState can radically reduce the size of pages you send over the wire. See here: http://msdn.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic9

·         If you are using Ajax, ensure <compilation debug=”false”/> is set in your web config. This avoids very costly parameter validation on both the client and server. See "Significantly Better Debugging Support" in ScottGu'sblog here: http://weblogs.asp.net/scottgu/archive/2006/10/20/ASP.NET-AJAX-Beta-1-Released.aspx

·         Run SQL Profiler against your database whilst doing normal activity, identify all SQL access that has high duration or CPU values and optimise them.

 

Published Tuesday, June 17, 2008 10:44 AM by Flo
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker