Performance tuning IIS for multiple concurrent threads

ASP.NET and IIS scale very well, but you’ll need to change a few settings to set up your server for lots of concurrent connections, as opposed to lots of requests per second.

IIS Configuration

Max concurrent requests per application

Increase the number of concurrent requests IIS will serve at once:

  • Open an administrator command prompt at %windir%\System32\inetsrv\
  • Run the command below to update the appConcurrentRequestLimit attribute to a suitable number (5000 is the default in IIS7+)


appcmd.exe set config /section:system.webserver/serverRuntime /appConcurrentRequestLimit:100000

ASP.NET Configuration

Maximum Concurrent Requests Per CPU

By default ASP.NET 4.0 sets the maximum concurrent connections to 5000 per CPU. If you need more concurrent connections then you need to increase the maxConcurrentRequestsPerCPU setting.

  • Open %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet.config (Framework64 for 64 bit processes)
  • Copy from the sample below (ensure case is correct!)


<?xml version="1.0" encoding="UTF-8" ?>
        <legacyUnhandledExceptionPolicy enabled="false" />
        <legacyImpersonationPolicy enabled="true"/>
        <alwaysFlowImpersonationPolicy enabled="false"/>
        <SymbolReadingPolicy enabled="1" />
        <shadowCopyVerifyByTimestamp enabled="true"/>
    <startup useLegacyV2RuntimeActivationPolicy="true" />
        <applicationPool maxConcurrentRequestsPerCPU="20000" />

Request Queue Limit

When the total amount of connections exceed the maxConcurrentRequestsPerCPU setting (i.e. maxConcurrentRequestsPerCPU * number of logical processors), ASP.NET will start throttling requests using a queue. To control the size of the queue, you can tweak the requestQueueLimit.

  • Open %windir%\Microsoft.NET\Framework\v4.0.30319\Config\machine.config (Framework64 for 64 bit processes)
  • Locate the processModel element
  • Set the autoConfig attribute to false and the requestQueueLimit attribute to a suitable number


<processModel autoConfig="false" requestQueueLimit="250000" />

Performance Counters

The following performance counters may be useful to watch while conducting concurrency testing and adjusting the settings detailed above:


  • .NET CLR Memory# bytes in all Heaps (for w3wp)


  • ASP.NET\Requests Current
  • ASP.NET\Queued
  • ASP.NET\Rejected


  • Processor Information\Processor Time


  • TCPv6\Connections Established
  • TCPv4\Connections Established

Web Service

  • Web Service\Current Connections
  • Web Service\Maximum Connections


  • .NET CLR LocksAndThreads\ # of current logical Threads
  • .NET CLR LocksAndThreads\ # of current physical Threads

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.