Implementation of Network Load Balancing distributed job scheduling system

Source: Internet
Author: User
Keywords Algorithm can realize Network Load Balancing dispatch system

1. Introduction

In essence, Network Load Balancing is an implementation of distributed job scheduling system. As the controller of Network request allocation, the equalizer uses centralized or distributed policy to allocate network service requests according to the current processing capability of cluster nodes, and monitors the effective state of each node in the lifecycle of each service request. Generally speaking, the equalizer has the following characteristics for the scheduling of requests:

Network SERVICE requests must be manageable

The requested assignment is transparent to the user

Better able to provide http://www.aliyun.com/zixun/aggregation/13440.html "> heterogeneous system Support

Ability to dynamically allocate and adjust resources based on cluster nodes

The load balancer allocates workloads or network traffic across the cluster's service nodes. You can statically set up or determine which specific node the load is distributed to, depending on the current network state, and the nodes can connect to each other within the cluster, but they must be directly or indirectly connected to the equalizer.

Network balancer can be regarded as the job scheduling system on the network level, most network load balancer can realize a single system image at the corresponding level of the network, the whole cluster can be embodied as a single IP address is accessed by the user, and the specific service node is transparent to the user. Here, the balancer can be statically or dynamically configured, using one or more algorithms to determine which node obtains the next Network service request.

2. The principle of network balance

In the TCP/IP protocol, the data contains the necessary network information, so the information of the packet is very important in the realization algorithm of the network cache or network balance. However, because packets are group-oriented (IP) and connection-oriented (TCP) and are often fragmented, there is no full information about the application, especially the state information related to the connection session. Therefore, you must look at the packet from the point of view of the connection-the connection from the port of the source address to the destination port.

Another element of balanced consideration is the resource usage state of the node. Because load balancing is the ultimate goal of this kind of system, it is another key problem that the dynamic load Balancing cluster system of network dynamically adjusts the load balance task distribution according to the current resource usage state of each node.

In general, Cluster service nodes can provide such things as processor load, application load, active users, available network protocol caches, and other resource information. Information is passed to the balancer through an efficient message mechanism, and the balancer monitors the status of all processing nodes and proactively decides who the next task is to pass. A balancer can be a single device or a set of devices that are parallel or tree-like.

3. Basic Network Load Balancing algorithm

The design of the balance algorithm directly determines the performance of the cluster in load balancing, and the poorly designed algorithm will result in the load unbalance of the cluster. The main task of the general balancing algorithm is to decide how to select the next cluster node and forward the new service request to it. Some simple balancing methods can be used independently, and some must be combined with other simple or advanced methods. And a good load balancing algorithm is not omnipotent, it generally only in some special application environment to play the most effective. Therefore, when we examine the load balancing algorithm, we should pay attention to the application surface of the algorithm itself, and take the cluster deployment as a comprehensive consideration according to the characteristics of the cluster, and combine different algorithms and techniques.

3. 1 Rotation method:

The rotary algorithm is the simplest and easiest way to implement all scheduling algorithms. In a task queue, each member (node) of the queue has the same status, and the rotation method simply selects the group of members in the order of rotation. In a load-balanced environment, the equalizer shifts the new request to the next node in the node queue, so continuously and periodically that each cluster node is selected alternately under Equal status. This algorithm is widely used in DNS domain name polling.

The activity of the Rotary method is predictable, and each node is chosen to be 1/n, so it is easy to compute the load distribution of the node. The Rotary method is typical for all the nodes in the cluster processing ability and performance of the same situation, in practical applications, it is generally used in conjunction with other simple methods is more effective.

3. 2 Hashing method

Hashing is also called hash, which sends a network request to a cluster node by a single shot irreversible hash function, according to some rule. Hashifa will show special power when other kinds of balancing algorithms are not very effective. For example, in the case of the UDP session mentioned earlier, because of the rotation method and several other kinds of algorithms based on the connection information, it is not possible to recognize the start and end tag of the session, which can cause application confusion.

A hash map based on the packet source address can solve the problem to a certain extent: sending packets with the same source address to the same server node, which allows transactions based on high-level sessions to run in an appropriate manner. In contrast, the hash scheduling algorithm based on the destination address can be used in the Web cache cluster, and the access requests to the same target site are sent to the same cache service node by the load balancer to avoid the update cache problem brought by the page missing.

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.