Setting an aspnet.config File per Application Pool
The aspnet.config file is a little known config file which is supported by ASP.NET 2.0 and greater. Generally it lives in the root of the framework folder, for example:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.configC:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.configC:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet.configC:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet.config
This config file is further leveraged in ASP.NET 4.0 for concurrency and threading. For example, you can set maxConcurrentRequestsPerCPU, maxConcurrentThreadsPerCPU and requestQueueLimit, in addition to the previous runtime settings.
In Windows Server 2008 R2 (IIS 7.5) support was added to allow different settings per application pool. Where previously the settings had to be applied to the whole framework version, now they can be specific to each app pool. It does this by allowing you to create a custom aspnet.config file per app pool. You can save them wherever you want on disk and IIS will pick them up when the app pool starts.
Note that the framework aspnet.config file is still used so only differences per app pool need to be set here.
Here’s an example of what the file can contain:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration><runtime>
<legacyUnhandledExceptionPolicy enabled="false" />
<legacyImpersonationPolicy enabled="true"/>
<alwaysFlowImpersonationPolicy enabled="false"/>
<SymbolReadingPolicy enabled="1" />
<shadowCopyVerifyByTimestamp enabled="true"/>
</runtime>
<startup useLegacyV2RuntimeActivationPolicy="true" />
<system.web>
<applicationPool
maxConcurrentRequestsPerCPU="5000"
maxConcurrentThreadsPerCPU="0"
requestQueueLimit="5000" />
</system.web>
</configuration>
