LVS load balancing scheduling algorithm

LVS Load balancing scheduling algorithm

1. Round Robin (rr )

The scheduler distributes external requests to the real servers of the cluster in turn through the “round-robin” scheduling algorithm. It treats each server equally, regardless of the server The actual number of connections and system load.

2, Weihted Round Robin (wrr)

The scheduler uses “weighted round robin” to schedule The algorithm schedules access requests according to the different processing capabilities of the real server. This can ensure that servers with strong processing capabilities can handle more access traffic. The scheduler can automatically inquire about the load of the real server and dynamically adjust its weight.

3. Least Connections (LC)

The scheduler dynamically uses the “Least Connections” scheduling algorithm Dispatch network requests to the server with the least established integrity books. If the real servers of the cluster system have similar system performance, using the “least connection” scheduling algorithm can better balance the load

4, weighted least link (Weighted Least Connections) (WLC)

In the case of large differences in server performance in the cluster system, the scheduler uses the “weighted least links” scheduling algorithm to optimize load balancing performance, which has a higher weight Of servers will bear a larger proportion of the active connection load. The scheduler can automatically inquire about the load of the real server and dynamically adjust its weight.

(5-7 cache clusters are used more)

5. Locality-Based Least Connections (LBLC)

It is load balancing for target IP addresses, currently mainly used in Cache cluster systems. The algorithm finds the server that was recently used by the target IP address according to the requested target IP address. If the server is available and not overloaded, the request is sent to the server; if the server does not exist, or the server is overloaded and there is a server in half For workloads, use the principle of “least links” to select an available server and send the request to that server.

6. Locality-Based Least Connections with Replication (LBLCR) with replication (LBLCR)

It is the load for the target IP address Balanced, currently mainly used in Cache cluster systems. The difference between it and the LBLC algorithm is that it maintains a mapping from a target IP address to a group of servers, while the LBLC algorithm maintains a mapping from a target IP address to a server. The algorithm finds the server group corresponding to the target IP address according to the requested target IP address, and selects a server from the server group according to the principle of “least connection”. If the server is not overloaded, the request is sent to the server; if the server is overloaded , Select a server from this cluster according to the principle of “least connection”, add the server to the server group, and send the request to the server. At the same time, when the server group has not been modified for a period of time, the busiest server is deleted from the server group to reduce the degree of replication.

7. Destination Hashing (DH)

According to the requested destination IP address, it is used as a hash The column key (Hash Key) finds the corresponding server from the statically allocated hash table. If the server is available and not overloaded, the request is sent to the server, otherwise it returns empty.

8. Source Hashing (SH)

According to the source IP address of the request, it is used as a hash The column key (Hash Key) finds the corresponding server from the statically allocated hash table. If the server is available and not overloaded, the request is sent to the server, otherwise it returns empty.

9. Shortest Expected Delay Scheduling SED (SED) (SED)

Based on wlc algorithm. This must be taken as an example: the weights of the three machines of ABC are 123 respectively, and the number of connections is also 123 respectively. Then if the WLC algorithm is used, when a new request comes in, it may be assigned to any one of ABC. After using the sed algorithm, such an operation will be performed:

A(1+1)/1

B(1+2)/2

C(1 +3)/3

According to the calculation result, the connection is handed over to C.

10. Never Queue Scheduling NQ (NQ)

No queue is required. If there is a realserver with the number of connections = 0, it will be allocated directly, and there is no need to perform sed operations.

Leave a Comment

Your email address will not be published.