Спрятать панель проектов Показать панель проектов
Donation Пожертвование  |  Дневник  |  Без рекламы  |  О сайте  |  Реклама  |  .mobile  |  Fleshlight     Прислать Гости: 2    Участники: 0  Авторизация   Регистрация 
Метод Научного Тыка
iMag | интернет-журнал


Начало » Разработка ПО » The difference between Web Farm and Web Garden

The difference between Web Farm and Web Garden


The difference between Web Farm and Web Garden
Добавлено: Пн 13.08.2018 (Sergeant)
Источник: https://www.c-sharpcorner.com/uploadfile/nipuntomar/web-farm-and-web-garden/
Автор: Nipun Tomar


A hosting environment consisting of multiple web servers is said to be a Web Farm. Usually a load balancer is used to tie together the web servers, which routes incoming requests amongst the servers within the web farm.

And these incoming requests are routed in a variety of formats: One from them is to use IP affinity (also called client affinity or sticky session); it's working is to route the incoming requests to the same web server for the duration of the web application session. It has a benefit that Session state data can be maintained in-process, just as it would on a single web server hosting environment, without the complications from alternating between web servers. However, a down-side to IP affinity is in not taking full advantage of the web farm capability in fully distributing and routing all requests and sessions.

USE: The Web farms are used in enterprise environments for highly-used web applications to provide fail-safe and reliable services. Web farms offload incoming traffic by alternating between servers and by evenly distributing web application load. This increases response time, performance, and reliability. Additional web servers may be added or taken away from a web farm to increase or decrease the web application performance, as necessary for target environment.

Advantages of a Web Farm

  • It Provides better scalability by handling large capacity;
  • Due to centralized monitoring of the web sessions good web site administration;
  • Optimum utilization of resources that can be shared to service clients;
  • It Provides redundancy by reducing failures with the help of fault tolerance techniques;
  • It Provides availability and better performance due to load balancing.


Web garden is a scenario in which a single machine has multiple ASP.NET worker processes running simultaneously. A web garden is utilized on a multi-core web server. To achieve more robust execution and processing of the C# ASP.NET web application threads, each worker process within the application pool would execute on an individual processor. It is created within Internet Information Services (IIS) by creating an application pool, selecting the Performance tab, and under the "Web Garden" section, setting the maximum number of worker processes to a value greater than 1.

USE: Rather than using the typical hosting environments, the web gardens use more resources, and may also be slower in performance due to which there is unnecessary complexity. It has useful 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 both 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.

The larger gain for web gardens is not speed, but rather robustness. Due to their robustness, enabling web gardens can often be a good way to see if a C# ASP.NET web application will function correctly in a multi-server web farm environment. Often, if a web application performs well in a garden scenario, it will typically be easier to migrate to a web farm.

Advantages of Web Garden

  1. It increases application availability;
  2. Less consumption of physical space with better capacity;
  3. Optimum utilization of processes running on multiple processors located in a single server;
  4. Finer grained partitioning of Web servers help to control the administration of web sites individually, though they reside on the same server;
  5. 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.


To implement a web farm in .Net, the following changes have to be made in a web.config file:

Mode = [inproc/StateServer/SqlServer]

The inproc option is to be used when there is no web farm, StateServer when performance is required while SqlServer, if reliability is needed, especially for mission critical applications.


To implement a web garden in .Net, the following changes have to be made in a web.config file:

  • webGarden=[true]
    Option, false used, if web garden is not necessary.
  • CpuMask=8
    Value for this section implies the decimal number, whose binary form represents the sequence of processors running ASP.NET processes on a multiprocessor server.

Difference between "Web farms" and "Web garden":

Web farms consist of two or more web servers of the same configuration and they stream the same kind of contents to minimize failures, hence web farms are used to have some redundancy. It consists of two or more web servers of the same configuration and they stream the same kind of contents. When any request is received there is switching / routing logic that decides which web server from the farm handles the request. Whereas in short we can define a model in which multiple processes run on multiple CPUs in a single server machine which is known as a web garden. Let's discuss that with the help of models:

All requests to IIS are routed to "aspnet_wp.exe" for IIS 5.0 and "w3wp.exe" for IIS 6.0. In a normal case i.e. without a web garden we have one worker process instance ("aspnet_wp.exe" / "w3wp.exe") across all requests. This one instance of worker process uses the CPU processor as directed by the operating system:

But when we enable a web garden for a web server it creates different instances of the worker process and each of these worker processes runs on different CPUs. You can see in the diagram below we have different worker process instances created which run on different CPUs.

Nipun Tomar

Мне нравится
Мне не нравится

Писать комментарии могут только авторизованные пользователи.

Комментарии (0)
Нет ни одного комментария.
Поделиться ссылкой:
Как правильно пить ром – 4 способавчера, 15:12Как правильно пить ром – 4 способа
Два лучших рецепта малиновой наливкиПт 16.11.2018 – Два лучших рецепта малиновой наливки
Готовим сочное мясо в духовке: 5 беспроигрышных рецептовПт 16.11.2018 – Готовим сочное мясо в духовке: 5 беспроигрышных рецептов
Пт 16.11.2018 – Проститушка
HDR10 и его отличие от Dolby VisionЧт 15.11.2018 – HDR10 и его отличие от Dolby Vision
Почему электромобили не так экологичны, как это принято считатьСр 14.11.2018 – Почему электромобили не так экологичны, как это принято считать
Mastering Entity Framework Core 2.0Вт 13.11.2018 – Mastering Entity Framework Core 2.0
Год: 2017
Правила группового секса в свинг-отеляхВс 11.11.2018 – Правила группового секса в свинг-отелях
Десять лучших домашних закусок к пивуСб 10.11.2018 – Десять лучших домашних закусок к пиву
Почему электромобили – это утопияСр 07.11.2018 – Почему электромобили – это утопия
Автомобиль Hennessey Venom GTВт 06.11.2018 – Автомобиль Hennessey Venom GT
Семь баз данных за семь недель. Введение в современные базы данных и идеологию NoSQLВт 06.11.2018 – Семь баз данных за семь недель. Введение в современные базы данных и идеологию NoSQL
Год: 2013
Пн 05.11.2018 – Найм программистов. Советы от программиста
Среди свингеровВс 04.11.2018 – Среди свингеров
Три удачных рецепта домашних апельсиновых наливокСб 03.11.2018 – Три удачных рецепта домашних апельсиновых наливок

Разработано на основе BlackNight CMS
Release v.2018-11-01
© 2000–2018 Blackball
Дизайн & программирование:
Sergeant Центр Связи с Админом Skeleton
О сайтеРеклама
Web-site performed by Sergey Drozdov