Having recently completed a large website implementation for a well respected not-for-profit organisation, I learnt several lessons and want share some of my experiences.
While it seems obvious that we should be ensuring our code is optimised (right? :-/), there are some factors that are "factory-set" and may need to alteration to suit your application and its environment.
Two good resources for you to look at are :-
1) Microsoft's Improving .NET Application Performance and Scalability, especially Chapter 17.
2) Paul Glavich and Chris Farrell's .NET Performance Testing and Optimization - The Complete Guide
An important attribute of tuning that was relevant for this implementation was maxconnection. This particular application made calls to a remote WCF service, and we changed the value from the default (being 2) to an appropriate value. The MS resource recommends that you set it to 12 times the number of CPUs.
The maxconnection attribute can be found on the <ConnectionManagement> element in Machine.config. The default values are as follows.
<connectionManagement> <add address="*" maxconnection="2"/> </connectionManagement>
I added an extra 'row' for the WCF service ... thus, the config entry become .... (the IP address has been changed to protect the innocent).
<add address="127.0.0.1" maxconnection="24"/> <add address="*" maxconnection="2"/> </connectionManagement>
Other attributes you should consider are :-
So, the moral of this adventure is not to forget to tune your application for your destination environment. I even recommend having a "tuning champion" in your organisation (or even become the champion yourself!)
Until the next installment...
A commenter, Md Tariq Ul Azam, mentioned
<processModel autoConfig="true" />
Now, it is correct that it sets maxIoThreads, maxWorkerThreads, minFreeThreads, minLocalRequestFreeThreads and the maxConnection settings based on the machines' configuration. How it sets these values are detailed here. The processModel element is detailed at MSDN.
But, I do recommend reading a great article by Omar Al Zabir over at CodeProject called 10 ASP.NET Performance and Scalability Secrets.
Omar points out, and I agree with him, that you should tweak the values.