Analysis of Load Balancing Algorithm Concept

1. Round Robin method 

  1) Distribute the requests to the backend servers in turn, and treat each server in a balanced manner, regardless of the actual number of connections to the server and the current system load.
  
  2) Disadvantages: When the server hardware configuration in the cluster is different and the performance difference is large, it cannot be treated differently.

2. Weight Round Robin (Weight Round Robin) method 

  1). Solve the shortcoming that the polling method cannot be treated differently according to the performance of the machine.

3. Random method

  1) According to the random function of the system, one of them is randomly selected for access according to the size of the backend server list. As the volume of calls increases, the actual effect is getting closer and closer to the even distribution of traffic to each server in the background, that is, the effect of the polling method.


4. Source address hashing method
  
  1). According to the IP address of the client requested by the service consumer, a hash value is calculated through the hash function, and the hash value is modulo the size of the server list, and the result is Is the serial number of the server address to be accessed. The source address hashing method is used for load balancing. If the server list of the same IP client remains unchanged, it will be mapped to the same backend server for access.

5. The least connection number method (a load balancing algorithm in the true sense)

  1) According to the current connection status of the back-end server, dynamically select the server with the least number of connections in the current backlog to process the current request, improve the utilization of the back-end server as much as possible, and distribute the load to each server reasonably.

Guess you like

Origin blog.csdn.net/qq_36336332/article/details/104477699