Advertisement
Поиск  
Always will be ready notify the world about expectations as easy as possible: job change page
Jul 4, 2018

The difference between Web Farm and Web Garden

Автор:
Nipun Tomar
Источник:
Просмотров:
376

WEB FARM:

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:

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.

IMPLEMENTATION OF WEB FARM IN .NET:

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.

IMPLEMENTATION OF WEB GARDEN IN .NET:

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.

Написать сообщение
Почта
Имя
*Сообщение


© 1999–2024 WebDynamics
1980–... Sergey Drozdov
Area of interests: .NET Framework | .NET Core | C# | ASP.NET | Windows Forms | WPF | HTML5 | CSS3 | jQuery | AJAX | Angular | React | MS SQL Server | Transact-SQL | ADO.NET | Entity Framework | IIS | OOP | OOA | OOD | WCF | WPF | MSMQ | MVC | MVP | MVVM | Design Patterns | Enterprise Architecture | Scrum | Kanban