다음을 통해 공유


Maximum number of Application Pools in IIS 6.0

The maximum number of Application Pools that IIS 6 can host depends on a few different things, including (but not necessarily restricted to) the type(s) of content being served, the number of application pool running concurrently, and the identities of the application pools. Other things like type of hardware, average load, etc. also will come into play whenever the question of load testing and performance tuning web applications comes up. However, following are a few things to keep in mind regarding how many application pools IIS6 can handle.

 

 

Type of content being hosted

How many application pools IIS6 can host is partially affected by the type of content being hosted - static/HTML vs. dynamic/ASP vs. managed/ASPX. In general, testing shows that IIS6 can run more than approximately 4 times as many application pools that host only HTML than those that host dynamic ASPX applications. Further, IIS6 can run more application pools hosting ASP than ASPX, but fewer hosting ASP than static HTML. (In other words, ASP application pools fit in somewhere in the middle). These are not exact numbers, but just the general rule that you can run more app pools with static content only than with ASP, and more with just ASP than with ASPX.

 

If the different app pools are hosting dynamic content (ASP), you can boost performance by setting the ASPExecuteInMTA metabase key. Setting this key will allow ASP to run on MTA instead of STA. This is discussed in the IIS6 Static and Dynamic Hosting article at https://technet.microsoft.com/en-us/library/cc780141.aspx:

 

Because of the overhead memory and CPU cost of running dynamic applications, your server will reach a limit in the number of application pools it can host. With ASP content, you can mitigate this limitation on application pools by enabling ASP pages to run on multithreaded apartment (MTA) threads instead of single-threaded apartment (STA) threads. ASP is capable of running all of its threads in an MTA. If your COM components are primarily free-threaded or both-threaded, running the ASP threads as MTA can improve performance significantly. By default, the AspExecuteInMTA metabase property is set to 0, which means that ASP does not execute in MTA. Set this property to 1 at the application level to enable ASP to run in MTA.

 

 

More information on the ASPExecuteInMTA key here: https://msdn.microsoft.com/en-us/library/ms524810.aspx. It is important to note that this will NOT affect application pools running ASPX applications. ASPX app pools are much more strictly bound to upper limits in terms of concurrent numbers than ASP. If some of your app pools are running ASP and some are running ASPX, you will not be able to squeeze as much perf out of that scenario in terms of max # of app pools than if only ASP was being served across all the pools.

 

 

 

Number of Application Pools concurrently running

When considering the maximum number of application pools your server can handle, it is not necessarily the total number of application pools that is important, but rather how many pools are concurrently running. For example, you can have 1000 application pools in total, but only 200 are ever running at the same time. The trick here is to reduce the number of application pools that are running that are idle (not handling any HTTP requests).

 

To reduce the number of application pools that are running when idle (that is, not currently handling requests but still taking up system resources), lower the IdleTimeout metabase value for the application pool. You can do this in the IIS manager by lowering the pool’s "Shutdown worker processes after being idle for..." setting on the Performance tab of the application pool’s Properties. The default is 20 minutes, but you can modify this depending on your application and business requirements.

 

More information on the IdleTimeout property can be found at https://msdn.microsoft.com/en-us/library/ms525537.aspx and https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/83b35271-c93c-49f4-b923-7fdca6fae1cf.mspx?mfr=true

 

 

Application Pool Identities

Whether your application pools use their own identities or use a shared identity (such as Network Service) will also effect how many application pools the server can host. If an IIS6 server has more than approximately 60 separate worker processes all with their own identities, resource allocation problems may occur. On the other hand, if all of the application pools use the same account for their identity, the same resource allocation problems should not occur.

 

If you require your application pools to have separate identities and you do not want to run into the resource allocation problems, you can use the UseSharedWPDesktop registry key as follows:

 

1. Click "Start", click "Run", type "regedit" (without the quotation marks), and then click "OK".

2. Locate the following registry key:

 

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC

 

3. Right-click "Parameters", point to "New", and then click "DWORD Value".

4. Type "UseSharedWPDesktop" (without the quotation marks).

5. Set the value for this new key to 1.

6. Quit Registry Editor, and then restart IIS.

 

 

More information on the topics discussed here can be found in the following article:

 

IIS6 Shared and Dynamic Hosting

https://technet.microsoft.com/en-us/library/cc780141.aspx

Comments

  • Anonymous
    February 03, 2009
    Mike do you have similar information for IIS 7.0? I am planning to use an Application Pool for each .NET Framework 3.5 application along with an identity for each Application / Application Pool on IIS 7.0. Do you have any recommendations or additional information that would support this?

  • Anonymous
    February 03, 2009
    Hi Derek - The basic premises should be the same for IIS 7, at least in terms of type of content being hosted and leaving idle app pools running.  I'm not sure if the Identity issue bubbles up in IIS7 or not...you might want to check the forums on http://www.iis.net where some of our developers are regular contributers.

  • Anonymous
    February 03, 2009
    Mike - Thanks for the info! I will check out the forums on iis.net.

  • Anonymous
    April 13, 2009
    The comment has been removed

  • Anonymous
    April 14, 2009
    Hi Lukas, 150 mb of memory usuage is nothing to worry about.  I wouldn't start getting curious about memory usage in an ASP application process until the memory usage gets upwards of 500 mb at the very least, and/or until Out Of Memory -type errors start occurring. An app's memory usage jumping suddenly from 70mb to 150mb sounds to me like normal ASP template caching, which is a good thing.

  • Anonymous
    August 09, 2009
    Hi, I would like to know the inside story of the app pool. Can anyone please provide me some information on how app pool and worker process works together? Also I would like to know whether each and every application in the same can have seperate instances of w3wp.exe (in IIS 6)?

  • Anonymous
    February 14, 2010
    Thanks for the article! Does anybody know how App pools tuned in shared hosting environments (I mean hosting companies)?

  • Anonymous
    November 15, 2011
    Hi, I m having almost 15 applications in my server with 3 application pools. Sometimes pools are getting down. After some time pools become up. its happening on daily basis. Some one please get me solution. Thanks