A detailed explanation of LVS scheduling algorithm

Source: Internet
Author: User

The LVs scheduling method is divided into two main categories:

1. Static Scheduling method

2. Dynamic scheduling method

Static scheduling methods are divided into:

(1). Round-robin: Wheel called, abbreviation RR.

Wheel call scheduling is to call the way the request scheduling of different servers, that is, each dispatch execution i = (i + 1) mod n, and select the first server. The advantage of the algorithm is its simplicity, it does not need to record the current status of all connections, so it is a stateless scheduling. The wheel call scheduling algorithm assumes that all server processing performance is the same, regardless of the current number of connections and response speed of the server. The algorithm is relatively simple and does not apply to the situation of different processing performance in the server group, and when the request service time change is large, the scheduling algorithm can easily cause the load imbalance between the servers.

(2). Weighted Round-robin: Weighted round call, abbreviated WRR.

This algorithm can solve the performance of different servers, it uses the corresponding weights to represent the performance of the server, the server's default weight is 1. Assuming that the weight of server A is 1,b 2, the processing performance of Server B is twice times that of a. The weighted round call scheduling algorithm allocates requests to each server according to the weights and the rotations. High weights of the server first received the connection, the weight of the server than the low weight of the server processing more connections, the same weight of the server processing the same number of connections.

(3). Destination hashing: Target address hash, referred to as DH.

The target address hash scheduling algorithm first according to the target IP address of the request, as the hash key (hash key) from the statically allocated hash table to find the corresponding server, if the server is available and not overloaded, send the request to the server, otherwise return null, mainly used for caching servers.

(4). SOURCE hashing: The origin address hash, referred to as SH.

The source address hash scheduling algorithm is just the opposite of the target address hash scheduling algorithm, it is based on the requested source IP address, as the hash key (hash keys) from the statically allocated hash table to find the corresponding server, if the server is available and not overloaded, send the request to the server, or return empty. It uses the same hash function as the target address hash scheduling algorithm.

Dynamic scheduling methods are also divided into:

(1). least connections: Minimum link, short LC.

The schedule is to assign a new connection request to the server with the smallest number of current connections. The minimum connection scheduling is a dynamic scheduling algorithm, which estimates the load of the server by the number of connections currently active by the server. The scheduler needs to record the number of connections that each server has established, and when a request is dispatched to a server, the number of connections is 1, and the number of connections is reduced by 1 when the connection is aborted or timed out.

Calculates the current Realserver load situation calculation method: Active*256+inactive=overhead.

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.