In my Web farm, I've set my Web sites to use not more than 10 percent of the CPU. I've reset the monitoring interval from 24 hours to 10 minutes so that if a site takes more than 10 percent of the CPU for 10 minutes, the server throttles the site. This setup isn't perfect, but it keeps individual sites from tying up the CPU. Can you suggest a better solution?

The difficulty of a situation such as yours is that you don't really keep a Web site from consuming more than its share of resources. Reducing the interval to 10 minutes is a good idea, but if a Web site is using more than its share, which in your case is more than 10 percent of the CPU for longer than 10 minutes, disconnecting that Web site for 10 minutes regains only 10 percent of your CPU. When that Web site comes back online, the application is launched again and the CPU use rises so that the Web site is throttled again. In addition, this setup works only on out-of-process (OOP) sites that have their own performance and overhead penalties. Microsoft documentation states that you should run no more than 10 OOP applications, although that number is probably conservative for most servers today.

Finally, this setup can have unintended consequences. When the Web site is throttled, IIS sets the dllhost.exe running the application to run at a lower priority. However, resources dedicated to serving the site's connections are still allocated, and the Web server can't serve those resources efficiently because the site is running at a lower priority. These resources are I/O threads that come from a pool for the entire server, so those resources aren't available to other sites, which is your concern. Consequently, this throttling can have the unintended effect of lowering overall server performance while increasing CPU availability. This performance decrease is relatively unlikely, but it can occur if the throttled site carries a lot of traffic and runs consumptive applications.

This problem becomes even more complicated in multiple-CPU systems. A site can run an application for which one CPU is at 100 percent and another CPU is at 20 percent. In such a situation, how do you determine the application's CPU utilization? Fortunately, CPU throttling is enhanced substantially in IIS 6.0 and should provide the kind of capability that you need.