IIS 7 Shared Hosting Summary
Damn! I love this blog post from Thomas, and you can easily noticed that IIS team has put lot of effort in shared hosting environment, from shared to delegated configuration, and all the way to process model improvements. The dynamicIdleThreshold for example is a fantastic feature for shared hosting, at first I got confused (while working on the IIS 7.0 Reskit Book) with the formula implementation, then Bill hooked me up with Fabio - the main guy behind the logic to give me the full picture about the idea/logic/formula about it. It actually took me a while to understand :) LOL, getting old...
Anyway, another related feature is called Process Gating, well this is not new and was actually in IIS 6.0, but not many know about it. Process gating grants you the ability to specify the maximum worker processes that allow to run concurrently in a machine, this prevent that too many worker processess running and eventually slow down / kill the entire server especially in high density hosting setup. Similar to number of web sites a particular box can support, you need to perform stress testing and trend analysis to understand the usage model,etc before deciding on the reasonable numbers of worker processes to limit and prevent too many worker processess choking the server.
How it works....Similar to IIS 6.0, IIS 7.0 always performs a demand start for Web application, worker processes only invokes by Windows Process Activation Service (WAS) when the application pool receives the first incoming request. Before WAS initializes the new worker process, it first checks the total number of current running worker processes. If the total amount of worker processes (current + new one) is more than the maximum worker processes allowed, then the new worker process is not started and IIS keeps the request in the queue and wait until the number of worker processes drop below the limit and starts the new worker process.
How to configure....
There is no user interface to enable demandStartThreshold in RTM releases. But with the IIS 7.0 Admin Pack, I think it should be listed as one config item in the new
configuration editor, my Vista box is not with me now, so can't verify this. Anyway, you can always configure this via AppCmd.exe. For example, to limit a total of 100 worker processes for a particular IIS 7.0 web server, try
appcmd set config /section:webLimits /demandStartThreshold:100
Upon successfully executing the command syntax, you will see the output shown as below.
Applied configuration changes to section "system.applicationHost/webLimits" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
When WAS detects that it hits the demandStartThreshold limit, it writes a warning entry into the System event log. Take note that by default, process gating feature is not enabled, in the sense that the default total number of worker processes allowed is 2147483647 processes, which technically equivalent to no limit.