7th. Performance and Reliability mode load-balanced Cluster (load Balancing cluster)

Source: Internet
Author: User

Context

You have decided to use clustering when designing or modifying the infrastructure layer to maintain good performance while adapting to changing requirements.

Problem

While maintaining an acceptable level of performance, how can you design a scalable infrastructure layer that adapts to load changes?

Impact factors

When designing a scalable infrastructure layer, consider the following factors:

    • For any given application, a separate server is limited by the maximum load capacity. For example, if a single server makes a Web page available to users as part of a web-based application, and the user or transaction load increases and exceeds the server's limit, application performance drops below the expected value and, in the worst case, becomes unavailable.
    • A separate server has the maximum physical performance limit, including the bus speed, amount of memory, number of processors, and the number of peripherals that can be used by any server. For example, if the server can only hold four processors, you cannot add a fifth processor to improve performance.
    • Some applications have a limit on the number of CPUs that can be used.
    • The server acts as a separate entity, which is a single point of failure in the solution. If only one server is responsible for passing the functionality of the component within the application, its failure can cause the application to fail.
    • Adding servers increases the complexity of managing and monitoring server hardware and its associated software.
Solution Solutions

Install services or applications on more than one server and configure them as shared workloads. This type of configuration is load-balanced Cluster. Load balancing improves the performance of server-based programs, such as WEB servers, by dispersing client requests across multiple servers. Load balancing techniques, often referred to as "load balancers," can receive incoming requests and redirect them to specific hosts as needed. A load-balanced host can respond to different client requests at the same time, even multiple requests from the same client. For example, it is possible for a Web browser to obtain multiple images contained by a single Web page from different hosts in the cluster. This distracts the load, speeds up processing, and shortens the response time to the client.

The load balancer uses different algorithms to control traffic. These algorithms are used to intelligently distribute the load and/or to maximize the utilization of all servers within the cluster. Some examples of these algorithms include:

    • cyclic method. the loop algorithm distributes the load evenly to each server regardless of the current number of connections or response times. The cyclic approach is appropriate for servers in the cluster that have the same processing power; otherwise, some servers may receive requests that exceed their processing power, while other servers have more processing power.
    • weighted cyclic method. The weighted loop algorithm is suitable for situations where each server has different processing capabilities. The administrator assigns the performance weights to each server manually and automatically generates a schedule sequence according to the server weights. The system then directs the request to a different server according to the cyclic schedule sequence.
    • minimum connection. the least-connection algorithm sends the request to the server, depending on which server in the cluster is currently processing the fewest number of connections.
    • based on load. the load-based algorithm first determines which server in the cluster has the lowest current load, and then sends the request to the server.

In addition, some load balancers also have fault detection capabilities. The balancer can track a server or an application running on the server and stop sending requests to the server after a failure occurs. Figure 1 shows the basic components of load balancing.

Figure 1: Load Balancing Component

When a load balancer receives a request from a client, a server in the cluster group processes the request. Each server is able to process requests independently. If any server is unavailable due to an error or maintenance, other servers can still service the request without being affected. Therefore, the overall availability of the service is much higher than the scenario in which all requests are processed by a single server. However, if a single physical load balancer or a single network switch is used in front of a set of software load Balancing servers, another point of failure will be introduced. You can reduce this risk by using redundant load balancing devices and/or switches.

Session state Management

In a complete use case, an application typically needs to interact with the user between steps. As users implement their goals, each response they interact with affects the state of the options and applications that are available to the user. The term "session state" is typically used to describe this use case-centric state. Part of this session state is used only to track the progress of a task and discard it after it is finished, and if the use case succeeds, the rest of the session state is saved in the database for long-term storage. For example, a user who uses an online shopping cart chooses the checkout button (which is enabled only if there is at least one item in the cart) and rarely asks the user for payment or shipping information.

Distributed applications typically invoke software components on a remote server over a network connection. The application must track changes in the session state between the steps to provide continuity between them. Application designers typically maintain session state in one of the following three basic locations:

    • client. The Application Designer stores the session state of each user on the user's computer.
    • Intermediate Server. Application Designers store session state on a computer that acts as a mediator between a client computer and a database server that permanently stores user information.
    • database server. Application Designers store session state with other long-term applications and user data in the database server.

Only the intermediate server method affects this mode. Each method and its advantages and disadvantages are described in detail in chapter 2nd, "Designing for Scalability" in designing for Scalability with Microsoft Windows DNA [Sundblad00].

If all the servers are stateless (that is, the server's state reverts to the default after the server processes the request), a simple solution (the solution shown in 1) is sufficient. In both cases, the server can be stateless. First, the client does not need a session; That is, each request is a separate unit of work, and there is no persistent temporary value between requests. Second (called "Client Session Management"), the client itself saves the state of the session and sends the session state information within the request so that any server can check the request and continue to process it.

In a server session management scenario, the server is responsible for maintaining the state of the user session. Server session management requires that the load Balancer direct all requests from one client in the same user session to the same server instance. This mechanism is often referred to as a "server relationship."

One problem with session management itself is that if the server goes offline due to an error or maintenance, the client's work may be lost, and the client must resend all requests that have been sent in the lost session. In some cases, accidental loss of sessions is not a big problem for users. For example, in an online map search application, if the server loses the address that the user just typed, it won't be too much of a hassle for the user to retype the address. However, in other cases, session loss can be extremely inconvenient. For example, in an online lease application that has a stateless client, it may take the user 10 minutes to type a few pages of valuable information into the Contract table. If one server in a load-balancing group goes offline, you certainly don't want users to spend another 10 minutes retyping all the information. To avoid session loss due to server failures in the load balancing group, there are two ways to do this: centralized state management and asynchronous session state management. Figure 2 shows centralized state management.

Figure 2: load-balancing and centralized state management

The centralized state management method stores session-state information on a centralized server that is in a different tier from the application server. Each time the application server receives a request that is part of the session, it extracts the session state from the session Management Server and processes the request. The session Management Service can be a database or another type of application that runs on a server that has a shared resource and has a highly reliable configuration. For more information about how to improve fault tolerance on shared resources, see Failover Cluster mode.

Figure 3 shows the asynchronous session state management.

Figure 3: load Balancing and asynchronous session state management

When using the asynchronous session state management method, each server broadcasts its session state to all other servers whenever a session state change occurs, so each server contains state information for all sessions, and any server can process the requests contained in the session. The session state also persists after a separate server failure occurs. This solution is more economical because it does not require additional equipment, but it is more difficult to configure and maintain because it involves asynchronous calls. Storing the state of all sessions on each server also results in less efficiency.

Realize

The two main types of load balancing implementations are:

    • Software-based load balancing. Software-based load Balancing includes special software that is installed on the server in a load-balanced cluster. The software assigns or accepts requests made by the client to the server based on different algorithms. The algorithm can be a simple loop algorithm, or it can be a more complex algorithm that considers server relationships. such as,microsoft® Network load Balancing is a load balancing software for Web farms, while the Microsoft Component load balancing is a load balancing software for application farms.
    • hardware-based load balancing. hardware-based load balancing is made up of a dedicated switch or router that provides load balancing capabilities for software. This solution integrates the switching functionality and load balancing functionality into a single device, reducing the amount of additional hardware required to achieve load balancing. However, the combination of these two features also makes troubleshooting work for the device more difficult.
Example

To help you better understand how to use load balancing for scalability, the following discussion compares an existing non-load balancing solution that includes a single system, the failure point, in the application layer, with a highly scalable solution that maintains performance and provides availability.

Non-load Balancing layer

Initially, the organization might adopt a solution architecture similar to the one described in Figure 4, which might meet the initial performance requirements. However, as the load increases, the application layer must accommodate the increased load in order to maintain acceptable performance.

Figure 4: A basic solution with a single application server

In Figure 4, the application layer contains only one application server (APPSERVER20) that serves client requests. If the server is overloaded, the performance of the solution drops to an unacceptable level or becomes unavailable.

Load Balancing Layer

To improve scalability and maintain performance, organizations may use a load balancer to extend the application layer. In the following example (5), add two servers to the application layer to create a load-balanced cluster that accesses data-tier data and provides access to the application to the clients in the client tier.

Figure 5: a solution with a scalable application layer

This will get a standard load-balanced design. The hardware device or software running on the host assigns the virtual host name (APPSERVER20) and IP address to AppServer1, AppServer2, and AppServer3. A load-balanced cluster exposes this virtual IP address and host name to the network and distributes the load of incoming requests evenly among the normal running servers within the group. If the AppServer1 fails, simply direct the request to AppServer2 or AppServer3. Depending on the technology that provides this capability, a certain number of additional servers can be added to a load-balanced cluster to maximize scalability and meet growing demands ahead of the way.

Result context

The load-balanced Cluster mode has the following advantages and disadvantages:

Advantages

    • improved scalability. A scalable load-balancing layer allows the system to maintain an acceptable level of performance while increasing availability.
    • Higher availability. with load balancing, you can take the server offline for maintenance without making the application unavailable.
    • costs may be reduced. multiple low-cost servers typically reduce costs compared to higher-cost multiprocessor systems.

Disadvantages

    • The development process is complex. developing a load-balanced solution can be difficult if the solution must maintain the state of individual transactions or users.

The network failure problem is not resolved. if a server or network fails during a client session, you may need to log back in to re-authenticate the client and reestablish session state.

7th. Performance and Reliability mode load-balanced Cluster (load Balancing cluster)

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.