Skip to Content

Load Balancing Algorithm

Algorithm Description

  • Round-robin. After receiving a new TCP connection, it is sent to each backend service node in turn.
  • Source address. Based on the source IP address of the TCP connection, a hash algorithm is used to forward the request to a specific service node. When the user accesses again with the same source IP, the access will still route to the same service node if the number of service nodes remains unchanged.
  • Source address (calculating 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 supports packet forwarding mode)
  • Consistent hashing. The consistent hashing algorithm selects backend service nodes based on the source and destination IP addresses using the result of the consistent hashing algorithm. Adding or removing backend service nodes will only affect a small number of connections. (Only supported in the packet forwarding mode)
  • Consistent hashing (calculating port). Based on the source and destination IP addresses and ports, the consistent hashing algorithm result is used to select backend service nodes. Adding or removing backend service nodes will only affect a small portion of connections. (Only supported in the packet forwarding mode)
  • 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. Upon receiving a new TCP connection, the number of connections from the CLB to backend service nodes is statistically calculated in real time, and the service node with the lowest number of connections is selected to establish a new connection and transmit data. (Only supported in the request proxy mode)
  • 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.)
ModeSupported Forwarding Algorithm
Packet Forwarding ModeRound Robin, Source Address, Weighted Round Robin, Source Address (Calculating Port), Consistent Hashing, Consistent Hashing (Calculating Port), Master-Slave
Request Proxy ModeRound Robin, Source Address, Weighted Round Robin, Least Connections, Master-Slave