I highly recommend turning off the idle timeout in most situations. It's the default but it's meant more for bulk hosters that want unused worker processes to be ended so that they can always assume that they won't have all of them running at the same time.
However, if you have just a few production app pools on a server but occasionally don't have a visitor in a 20 minute space (i.e. overnight), you don't want your app pool to stop. You likely have enough resources to have all of your app pools running at once.
Additionally the default settings of recycling the app pool at 1740 minutes should also be changed. I recommend scheduling it for an off-peak time like 4:00am daily rather than having it at different times each day. More on that here on my website.
IIS Optimization and Performance Tuning is quite a broad topic, and your bottleneck(s) could be several places.
First, you can better determine what your bottlenecks are by using the Performance Monitor.
Based on what you find there, you can move on to trying the following IIS performance tuning options:
- Use IIS
Compression.
- Enable at least static caching, and enable dynamic caching if it makes sense to do so.
- Tune your Aspnet.config
files
and machine.config files and web.config connection
strings
for your application(s).
Checking your connection strings in web.config
By default, the max pool size for connection strings in a web.config file is 100, so try specifying something higher, like "Max Pool Size=200; Min Pool Size=10; Connect Timeout=45;"
.
Example:
<add name="SiteSqlServer" connectionString="Server=mydomain.com;Initial Catalog=myDB;User ID=DB;Password=myDB;Max Pool Size=100;Min Pool Size=10;Connect Timeout=45;" providerName="System.Data.SqlClient" />
Checking your settings in Aspnet.config
Location: C:\Windows\Microsoft.NET\Framework\v2.0.50727 and C:\Windows\Microsoft.NET\Framework64\v2.0.50727
Example:
<system.web>
<applicationPool maxConcurrentRequestsPerCPU="5000" <!-- Default is 12 -->
maxConcurrentThreadsPerCPU="0" <!-- Default is 0 -->
requestQueueLimit="5000" <!-- Default is 5000 -->/>
</system.web>
Checking your settings in machine.config
Location:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG and C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG
processModel
Example:
<processModel
enable="true"
requestQueueLimit="5000" <!-- Adjust if necessary. Default 5000 -->
restartQueueLimit="10" <!-- Adjust if necessary. Default 10 -->
memoryLimit="60" <!-- Adjust if necessary. Lower for memory leaks. -->
maxWorkerThreads="100" <!-- Default 20 -->
maxIoThreads="100" <!-- Default 20 -->
minWorkerThreads="40" <!-- Default 1 -->
minIoThreads="30" <!-- Default 1 -->
/>
connectionManagement
Example:
<system.net>
<connectionManagement>
<add address="*" maxconnection="100" <!-- Default is 2 --> />
</connectionManagement>
</system.net>
Best Answer
Check your web.config file for compilation mode. While you're developing, you should run your site in debug mode. If you're running in release mode, every aspx and ascx will be compiled into temporary assemblies, not only the pages and controls you hit. Also, set batch to false.
Of course, these are not recommended for production environments, which will be slowed down by these changes.
Also, check this forum thread, where you can find some interesting tips, like resetting the permissions of the ASP.NET temporary files folder: