The difference between Web farm and Web garden

Source: Internet
Author: User

In this blog post, I'll dissect the differences and principles of Web farm and Web garden, and the pros and cons of using them. Further, I'll show you how to create a Web garden in each version of IIS.

  English OriginalAbhijit Jana | October 2, 2010

Overview

Asp. The NET Development server is responsible for processing all requests and responses from the client (development phase). After development is complete, you must deploy the site to the server in order for others to access your site, which will involve the Web server. The Web server is responsible for processing all requests from the client and giving a response. Shows a typical single-IIS deployment architecture for ASP.

The client requests the resource, and IIS processes the request and responds.

Web Farm

The schema above applies to scenarios where only one Web server and multiple clients request resources from the same server. If the traffic on the site spikes, a single, independent server is not sufficient to handle client requests. In order to share the traffic, you may need to deploy the application to more than one server. This is called "Web Fram". Therefore, when you deploy a site to multiple Web servers that are associated with a load balancer (Balancer), a Web farm is formed. Shows the overall layout of the Web farm.

In the typical Web farm architecture, a single application is deployed to multiple IIS servers (known as the "Web Server"), and the server is connected by a load balancer as a VIP (Virtual IP). The load balancer is then connected to the external network. Therefore, the request from the client is first passed through the load balancer. The load balancer routes requests to the appropriate Web server based on the current traffic for each server. These Web servers may share the same database server (DB server), or they may use a duplicate server (replicated server) on the backend.

In short, when we deploy the same Web application on multiple Web servers to balance the load it is called "Web Farm".

Web Garden

Before I start to talk about Web garden, I want you to know the fundamentals of the application pool (application pool) and worker processes (worker process). If you have read how IIS Processes ASP. NET Request?, I have reason to believe that you are not unfamiliar with the above concepts.

In IIS, the worker process is responsible for running the ASP. All the ASP. NET functions are within the scope of the worker process (the author's description is a bit awkward). The worker process is responsible for processing all requests, responses, session data, and storing data. Application pools (application pool) are containers for worker processes. Application pools are used to isolate IIS worker processes, providing high security, high reliability, and high availability for Web applications.

By default, each application pool contains a worker process. An application pool that contains multiple worker processes (originally application, which is suspected to be the author's clerical error) is called "Web garden". is a typical Web garden application.

In, you can see that one of the application pools contains multiple worker threads, which makes up the Web garden.

Therefore, Web farm refers to the deployment of the same Web application to multiple servers and access based on the server's load, whereas a Web garden is a single application pool that contains multiple worker threads.

Creating Web Garden in IIS 6 and IIS 7

Now, I'll show you how to change the number of worker threads in Web garden in IIS 6 and IIS 7. In IIS 6, right-click application Pools > Properties > Go to the Performance tab.

In the Performance tab section, there is a "Web garden" option with the default value of "1", which you can set to the value you want.

In IIS 7, right-click application Pools > go to Advanced Settings > Find process model, with a maximum worker process item below. You can modify the default (1 by default) to create a Web garden.

In, you can also see the definition of the Web garden.

You can also refer to my earlier article on the current topic. >>

Advantages of Web farm and Web garden

Now, let's look at the advantages of Web farm and Web garden.

Advantages of Web Farm
    1. It provides high availability (or high fault tolerance). If any server in the farm goes down, the load balancer can redirect requests to other servers.
    2. Increased response times to client requests.
    3. Improves the stability of Web applications and reduces the failure rate of applications.
    4. Sessions and other resources can be stored centrally so that all servers can be accessed.
the advantages of Web Garden
    1. Increased application availability (or performance) through request sharing between work processes.
    2. The Web Garden allocates applications (based on parameters and tags) through processor affinity (Processor Affinity).
    3. Reduce physical space consumption.
Session Management in Web Farm mode

By default, the session mode is set to InProc. In this mode, session data is stored in the work. However, in Web farm mode, all servers can share the same session, and we can set the session mode to either state server or SQL Server mode. This allows session data to be shared even when some servers are down and requests are transferred to other servers through the load balancer.

In, you can see that two IIS servers share the same copy of the session data that is stored outside the worker process. You can refer to my earlier article, exploring session in ASP, which shows how to configure session mode in external process mode.

Session Management in Web garden mode

When we use the Web garden, the client requests are handled by different worker processes, so the session pattern must be the external process session mode described above. For Web garden, we must place the session in a different worker process on the same server.

Translator Note: Applications involving Web garden may require configuration <processModel> configuration section, which is read by Aspnet_isapi.dll and managed code is not read and is not described in detail here.

Summary

Web farm refers to the deployment of the same Web application to multiple servers and access based on the server's load, whereas Web garden refers to a single application pool that contains multiple worker threads.

In this blog post, I've elaborated on the basics of Web farm and Web garden. This article covers the basic information and concepts of Web farm and Web garden, as well as the configuration details of Web farm and Web garden, which I will cover in other articles. For more information, please refer to the following articles:

    1. Boosting performance using a IIS Web garden
    2. How-to Configure Session state in a Windows Web Farm
    3. Role of Web gardens and Web farms in ASP.

I hope this article will be of some help to you.

The difference between Web farm and Web garden

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.