Virtual Classes Logo          Virtual Classes
    Read Anytime,Anywhere

Web Garden

When a browser makes a request for a page,worker process ( w3wp.exe) running in IIS process the request.
Worker Process runs the ASP.NET application in IIS. All the ASP.NET functionality inside IIS runs under the scope of worker process. Worker Process is responsible for handling all kinds of request, response, session data and cache data.
Application Pool is a container of worker process, an application pool can have multiple worker process. Application pool separates IIS worker processes and enables better security, reliability, and availability for any web application.
By default, every Application pool contains a single worker process. Application Pool which contains the multiple worker process is called "Web Garden".
Web garden is a scenario in which multiple worker processes running simultaneously in an application pool.
Means, when an application pool has multiple worker process inside it then it is called web garden.
The below diagram shows the representation of Web Garden.

Web Garden

Many worker processes with same application pool provides better throughput performance and application response time. Each Worker Process have there own Thread and own Memory space.

Configure App Pool for Web Garden-
Right Click on Application Pool --> Properties --> GoTo Performance Tab,In bottom Group Section Increase the Worker Process Count.
Web Garden is useful in scenarios which may include when a non-CPU bound application needs to execute a long running request, such as an intensive computational request, long database transaction, or other long process. In these cases, a web garden could offer a solution by offloading the single worker process and distributing incoming requests amongst the workers in the application pool.

Advantages of Web Garden
1-Provides better application availability by sharing request between multiple worker process.
2-Optimum utilization of processes running on multiple processors located in a single server
3-Finer grained partitioning of Web servers help to control the administration of web sites individually, though they reside on the same server. With the concept of Processor affinity (binding the application to processor with the help of CPU masks), applications can be swapped out and restarted on the fly.
4-Less consumption of physical space for web garden configuration.

There are some limitations also in use of Web Garden.
If we are using "In Proc" Session Mode, your application will not work correctly because session will be handled by different Worker Process.
To avoid this Type of problem you should use "Out Proc" Session Mode.
Click here to read server site state management