Udostępnij za pośrednictwem


IIS7 – Improving ASP.NET performance (concurrent requests) while on Integrated Mode

If you were a ASP.NET 1.1 developer, and faced some performance problems, I’m sure you would have come across the KB 821268 which talks about tweaking maxWorkerThreads, maxIoThreads in the <processModel>, minFreeThreads, minLocalRequestFreeThreads in <httpRuntime>, maxconnection in the <connectionManagement> section. But for ASP.NET 2.0, we have <processModel autoConfig=”true” /> where these settings are tweaked in the runtime.

You may experience a performance issue while running your ASP.NET applications on IIS7 integrated mode. You might want to consider tweaking the number of concurrent requests per CPU on the server which can slow down the execution of the requests, and you will see few requests just waiting to be processed. By default, it sets a limit of 12 concurrent requests, and you can tweak the number by considering the below options registry key, or a equivalent configuration change if you have .NET 3.5 SP1:

[DWORD]

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727\MaxConcurrentRequestsPerCPU

Set this to a value higher than 12 (12 is the default)

If you already have SP1 for .NET 3.5 installed, this can be done via configuration itself:

Change the below in aspnet.config file (found in the framework folder)

<system.web>
<applicationPool maxConcurrentRequestsPerCPU="12" maxConcurrentThreadsPerCPU="0" requestQueueLimit="5000"/>
</system.web>

Thomas Marquart has explained about the changes in the IIS7 thread handling (integrated mode) in his blog. That’s a well written blog explaining how the ASP.NET threading model in IIS6/IIS7 handles the requests. Please read!

Comments

  • Anonymous
    April 11, 2010
    Hi, Currently we have a few clients with eCommerce sites written in ASP.NET who are complaining about performance on there site. We have tried a number of steps such as precompilation, disabling session states and reducing various other asp.net functionality but it seems a shame since we invested in using ASP.Net over PHP purely for functionality and streamlining development times.  After following this guide we found that this technique improve our sites performance by about 20 per cent.   I suggest this technique if you are interested in improving your sites performance and you are running IIS 7.

  • Anonymous
    April 11, 2010
    Stephen - Glad this post helped you. You can check this article http://technet.microsoft.com/en-us/magazine/2008.09.iis.aspx, and try to lean your webserver to get much better performance. In IIS7, you could just install what you want.