jump to navigation

What is the difference between Web Farm and Web Garden ? October 1, 2010

Posted by Abhijit Jana in ASP.NET, ASP.NET 4.0, IIS.
Tags: , , , , ,
trackback

I have been asked this question many times by different readers of my blog. They wanted to know about the fundamentals of Web Farms and Web Garden . In this blog post  I am going to explain the what is the exact difference between web farm and web garden, what are the advantages and disadvantages of using them. I have also described how to create web garden in different version of IIS.

Overview :

Visual Studio having its own integrated ASP.NET engine which is used to run the ASP.NET Web application from Visual Studio. ASP.NET Development Server  is responsible for execute all the request and response from client. Now after the end of development, when you want to host the site on some server to allow other peoples to access, concept of web servers comes in between.  A web server is responsible for  provide the response for all the requests that are coming from clients. Below diagram showing the typical deployment structure of a ASP.NET Web application with a single IIS.

2 Clients request for resources and IIS Process the request and send back to clients. If you want to know more details on How IIS Process the request please read one of my article over “How IIS Process ASP.NET Request ?” .

Web Farm :

This is the case, where you have only one web server and multiple clients requesting for the resources from the same server. But when there is huge numbers of  incoming traffic for your web sites, one standalone server is not sufficient to process the request.  You may need to use multiple server to host the application and divide the traffic among them.  This is called “Web Farm” . So when you are hosting your single web site on multiple web server over load balancer called “Web Farm”. Below diagram showing the over all representation of Web Farms.

 Web Farms

In general web farm architecture, a single application is hosted on multiple IIS Server and those are connected with the VIP ( Virtual IP ) with Load Balancer. Load Balancer IP’s exposed to external worlds to access. So whenever some request will come to server from clients, it will first hit the Load Balancer, then based on the traffic on each server LB distributed the request to corresponding web server.  These web server may share same DB server or may be they can use replicated server in the back end.

So, In a single statement, When we host a web application over multiple web server to distributed the load among them  is called Web Farm.

Web Garden :

Now, let’s have a look, what is Web Garden ?  Both the terms  sounds same,  but they are totally different with each other.  Before starting with Web Garden, I hope you have fundamental idea of what is Application Pool and what is Worker Process.  If you have already read the article  “How IIS Process ASP.NET Request ?” article then I can expect that you have now good idea on both of them.

Just to recall,  When we are talking about requesting processing with in IIS, Worker Process (w3wp.exe ) takes care all of these. 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 kind of request, response, session data, cache data.  Application Pool is the container of worker process. Application pools is used to separate sets of IIS worker processes and enables a better security, reliability, and availability for any web application.

apppoolsNow, by default each and every Application pool contains a single worker process. Application which contains the multiple worker process called “Web Garden”. Below is the typical diagram for a web garden application.

WebGarden BasicIn the above diagram you can see, on of the application containing the  multiple worker process, which is now a web garden.

So, a Web application hosted on multiple server and access based on the load on servers is called Web Farms and When a single Application pool contain multiple Worker process is called web garden.

Create Web Garden in IIS 6 and IIS 7

Now, I am going to show how you can change the Number of Worker process In both IIS 6 and IIS 7.  For IIS 6,  Right Click on Application Pool > Properties > Goto  Performance Tab.

WebGardenIIS6

In the “Performance Tab” Section you would have one option called “Web Garden” where worker process sets to “1”, you can set the number of worker process that you required.

For IIS 7, Right Click on Application Pool > Go To Advance Settings > In Process Model section, you will have “Maximum Worker Processes” . You can change it more than 1 to make it as web garden.

WebGardenIIS7

In the above image you can also check the definition of Web Garden also.

You can find one of my previous article on the basic of same over here

Advantages of Web Farm and Web Garden :

Now, let’s have a look in to the advantages of both the Web farms and Web Garden.

Advantages of Web Farm

  • It provides high availability. If any of the server in the farm goes down, Load balancer can redirects the requests to other servers.
  • Provides high performance response for client requests.
  • Provides Better scalability of the web application and reduce the failure of application.
  • Session and other resource can be stored in a centralized location to access by the all server.

Advantages of Web Garden:

  • provides better application availability by sharing request between multiple worker process.
  • Web garden use processor affinity where application can swapped out based on preference and tag setting.
  • Less consumption of physical space for web garden configuration.

How to manage session in Web Farm Mode ?

While using session, requests are distributed among different servers. By default session mode is set to In Proc where session data stored inside worker process memory. But, In Web farm mode we can share the session among all the server using a single session store location my making it Out proc (State Server or SQL Server Mode). So, if some of the server goes down and request transferred to the other server by the Load balancer session data should be available for that request.

sessionWebfarmIn the above diagram,  you can see we can both the IIS server sharing the same session data which is stored in out of worker process.  You can read one of my previous article “Exploring Session in ASP.NET” where I have explained how you can configure session mode for Out Process mode.

How to manage session in Web Garden Mode ?

When we are using Web garden where request is being taking care by different worker process we have to make the session mode as out process session mode as described earlier. For Web Garden we have configure the out process with in same server but for different worker process.

webgardenSession2

While using Web garden with your application you need do couple of configuration settings in web.config in <process Model> section where you need to set certain properties like cpuMask, RequestLimit, webGarden, ClientConnectCheck etc.

Summary : When we host a web application over multiple web server to distributed the load among them  is called Web Farm and when One application having multiple worker worker process called Web garden.

In this blog post I have explained the very basics of what Web Farm is and what Web Garden is. As this blog post contains the basic information to understand the fundamentals of  web farms and web garden concept, I will be posting a separate article with details configuration setting for web garden and web farm.  You can read those below articles for more information

 Boosting performance using an IIS web garden 

 How-To Configure Session State in a Windows Web Farm

Role of Web gardens and web farms in ASP.NET

Hope this will help you.

Comments»

1. DotNetShoutout - October 2, 2010

What is the difference between Web Farm and Web Garden ? « Abhijit’s World of .NET…

Thank you for submitting this cool story – Trackback from DotNetShoutout…

2. Weekly Archive – 2nd October 2010 « Abhijit's World of .NET - October 2, 2010

[...] What is the difference between Web Farm and Web Garden ? [...]

Terrence - May 30, 2012

Hi Abhijita

Thanks for this cool article,

Rgs
Terrence

3. RAVIKIRAN - October 10, 2010

Hi abhijit,
nice articles..ur rocking…i recently started to follow al ur articles.. thanks for your tremendous knowledge sharing to all readers.

Regards
Ravikiran
(frm EMS proj, brij’s beside seat,noida-60, hope ur do remember me)

Abhijit Jana - October 10, 2010

Yes Ravi !!

I remembered you !! How are you man !!

Thanks !
Abhiji

4. Web-Farm and Web-Garden « Yuva's blog - October 24, 2010
5. How to Use IIS Manager to get Worker Processes (w3wp.exe) details Information « Abhijit's World of .NET - November 4, 2010

[...] want to know more about Web garden or just wanted to recap please read on of my previous article  What is the difference between Web Farm and Web Garden ? [...]

6. Louis - November 18, 2010

Hi Abhijit, thanks for this information, it helped clear my doubts!
Cheers from Brazil!
Louis

7. Richard Lee - December 14, 2010

I enjoyed this article. Great read, clear and to the point. Keep it up.

Abhijit Jana - December 14, 2010

Thanks !! :)

8. raj - December 17, 2010

good knowledge

9. raj - December 17, 2010

have a great knowledge

10. Nauman - December 27, 2010

interesting !!! Good effort and clear understanding

11. What is the Difference Between Web Farm and Web Garden? « Technology Dynamics - March 13, 2011

[...] More details [...]

12. alok - March 17, 2011

Good Description. I hope you can describe the mvc in .net.

13. Nate - April 28, 2011

Simple and very clear to understand from freshers to expertise …kudos

14. prash - May 2, 2011

Good Knowledge for Web farm and web Garden

15. Navaneethakrishnan Thangaraj - June 24, 2011

Great stuff!

16. loges - June 29, 2011

Clear like crystal !!! Good Stuff abhijit !!! :-)

17. Gyanendra Kumar Mishra - July 8, 2011

just Excelent…………..
What an article it clears the concepts absolutely.Thanks Abhijit

18. kumar - July 28, 2011

Hi Abhijit… thanks for this….

19. Menaka - August 17, 2011

Good explanation and easy to understand,

Thank you,

20. lakshmipathy - September 6, 2011

Excellent Article thank you so much

21. Kumar - September 8, 2011

I must Say , Its a great article to understand the basics of Web Garden and Web farm..

22. What is the Difference Between Web Farm and Web Garden? « Technology Dynamics - September 18, 2011

[...] the entire article here: http://abhijitjana.net/2010/10/01/what-is-the-difference-between-web-farm-and-web-garden/ LD_AddCustomAttr("AdOpt", "0"); LD_AddCustomAttr("Origin", "other"); [...]

23. Jas - September 21, 2011

Please add one more point under Web Farm as server requirement.
Both the servers should be clone of each other i.e . They should be of smae OS / patch level

For example : You cannot have web farm with 1 server as windows 2003 and 2nd as windows 2008 hosting the same website

24. Kishor Shivane - October 19, 2011

Best article that i have ever read, thanks a lot :)

25. BreakHead - October 20, 2011

Nice Article!!

26. Joseph - November 15, 2011

Well explained. Thank you very much~

27. Asad Naeem - November 23, 2011

simply the best…

28. veda - January 7, 2012

Very clear..thanks a lot

Shweta - January 20, 2012

Very good and clear article..
Thanx…

29. VinaySanthosh - February 13, 2012

Thank you so much Very good article,sir do you have any forum so that if i have any doubts in the future

i can ask you.

30. Saraswathi Danda - February 18, 2012

Hey Abhijit… your articles are crystal clear.. really good and cool… they style of presentation is simple superb and makes me to read continuously. Became fan of your articles after reading IIS life cycle and next this one. Thank you so much for such a nice effort and hoping to come up with more and more articles. Thanks… Cheers :-)

31. My Latest Shared Bookmarksfboiton's blog | fboiton's blog - April 20, 2012

[...] What is the difference between Web Farm and Web Garden ? « Abhijit’s World of .NET – Comparte Este Post: [...]

32. ssss s - May 16, 2012

superb Article Thx…….For These nice Article…

33. Software Architecture-Some references to Sharpen skills related .Net « SoftArchitect - May 30, 2012

[...] http://msdn.microsoft.com/en-us/library/t8syafc7.aspx difference between Web Farm and Web Garden http://abhijitjana.net/2010/10/01/what-is-the-difference-between-web-farm-and-web-garden/ C# Value types VS Reference types C# Is a C# String a Value Type or a Reference Type? Lazy [...]

34. Deepika - June 25, 2012

nice…….
thanks a lot………

35. Kajal - September 18, 2012

Hi Abhijeet…
nice artical :) … but one question … what if one Worker process have some error in web garden?? will that web garden works?

36. Praveen - September 25, 2012

Nice one
Thanks

37. R - October 7, 2012

Nice article.
I would suggest you wrtie another article to elaborate steps to create a sample MVC.NET app with steps to deploy on web farm and web garden.

38. salman - October 8, 2012

great Article

39. Ramesh KP - October 18, 2012

nice article

40. Dilip - December 20, 2012

Good Article.

41. Rohit Shah - February 3, 2013

hi,
good article dude…..


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,745 other followers

%d bloggers like this: