C#

what is web farm and web garden


Web Farms and Web Garden are very common terminology for any production deployment. Though these terms look same but the things are totally different. Many beginners very confused with these two terms. Here I am giving the basic difference between the Web Farm and Web Garden.


Web Farm
After developing our asp.net web application we host it on IIS Server.  Now one standalone server is sufficient to process ASP.NET Request and response for small web sites but when the site comes for big organization where an millions of daily user hits then we need to host the sites on multiple Server. This is called web farms. Where single site hosted on multiple IIS Server and they are running behind the Load Balancer.
web farm


This is the most common scenarios for any web based production environment. Where Client will hit an Virtual IP ( vIP) . Which is the IP address of Load Balancer. When Load balancer received the request based on the server load it will redirect the request to particular Server.


Web Garden
All IIS Request process by worker process ( w3wp.exe). By default each and every application pool contains single worker process. But An application pool with multiple worker process is called Web Garden.   Many worker processes with same Application Pool can sometimes provide better throughput performance and application response time. And Each Worker Process Should have there own Thread and Own Memory space.

Web garden



There are some Certain Restriction to use Web Garden with your web application. If we use Session Mode to "in proc", our application will not work correctly because session will be handled by different Worker Process. For Avoid this Type of problem we should have to use Session Mode "out proc" and we can use "Session State Server" or "SQL-Server Session State".

How To Configure Web Garden?

Right Click on Application Pool > Properties > GoTo Performance Tab
In bottom Group Section  Increase the Worker Process Count.

Advantages of Web Farm and Web Garden
Now, let’s have a look into the advantages of both the Web Farms and Web Gardens.

Advantages of Web Farm
•It provides high availability. If any of the servers in the farm goes down, Load balancer can redirect the requests to other servers.
•Provides high performance response for client requests.
•Provides better scalability of the web application and reduces the failure of the application.
•Session and other resources can be stored in a centralized location to access by all the servers.

Advantages of Web Garden
•Provides better application availability by sharing requests between multiple worker process.
•Web garden uses processor affinity where application can be swapped out based on preference and tag setting.
•Less consumption of physical space for web garden configuration.


No comments:

Post a Comment