Load Balancing Algorithm
Algorithm Instructions
- Round-robin. After receiving a new TCP connection, it is sent to each backend service node in turn.
- Source address. According to the source address of the TCP connection, using a certain hash algorithm, the request is transferred to a certain service node. Subsequent user access with the same source IP, if the number of service nodes remains the same, the access will still fall to that service node.
- Source address (calculate port). According to the source address and source port of the TCP connection, using a certain hash algorithm, the request is transferred to a certain service node. (Only packet forwarding mode supports)
- Consistent hash. Consistent hashing algorithm is based on the source and destination IP, using the result of the consistent hashing algorithm to select backend service nodes. If the backend service nodes are added or removed, only a small part of the connections will be affected. (Only packet forwarding mode supports)
- Consistent hash (calculate port). Based on the source and destination IP, source and destination port, using the result of the consistent hashing algorithm to select backend service nodes. If the backend service nodes are added or removed, only a small part of connections will be affected. (Only packet forwarding mode supports)
- Weighted round robin. After receiving a new TCP connection, according to the different weights of the backend services nodes you specified, it will be allocated to each service node probabilistically.
- Least connections. When receiving a new TCP connection, it will calculate the number of connections from the CLB to the backend service node in real time, select the service node with the minimum number of connections to establish a new connection and send data. (Only request proxy mode supports)
- Master-slave. Only two service nodes can be added under VServer as master and slave nodes. When the health check of the master node fails, it will automatically switch to the slave node. (If there are service nodes under VServer, it is not allowed to switch from other load balancing algorithms to the “Master-Slave” algorithm.)
Mode | Supported Forwarding Algorithm |
---|---|
Packet Forwarding Mode | Round Robin, Source Address, Weighted Round Robin, Source Address (Calculate Port), Consistent Hash, Consistent Hash (Calculate Port), Master-Slave |
Request Proxy Mode | Round Robin, Source Address, Weighted Round Robin, Least Connections, Master-Slave |