Monday, October 13, 2014

Increasing IIS performance using a Web Garden

A web farm is where you have multiple servers serving the web site and these servers usually sit behind a load balancer. A Web Garden (introduced in IIS 6), is the concept of a single application pool having multiple worker processes.

In general web gardens are not recommended because they require overhead to operate (each worker process will consume a base level of RAM/CPU) and do not share resources. For example caching and session states are not shared between worker processes in web farms, so there is some duplication of work from that aspect.

However in cases where you have long running processes, that lead to queuing, there may be some performance benefits to using a web garden. As more threads are made available to process these requests, which leads to quicker processing overall.

You can setup web garden at the application pool level in IIS Manager. However before enabling in a production environment I recommend extensive testing to ensure there are no negative impacts to end users (application state/session) and that you don't overload the server (too many worker processes when little CPU/RAM is available).

Web Gardens are not a popular solution due to their overhead, and some people look at them as a band aid to poorly written code. Perhaps that is the case for the vast majority of web applications, yet there are always cases where the positives outweigh the negatives and a Web Garden leads to increased IIS performance.

No comments:

Post a Comment