In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "what is the working principle of common load balancing algorithms". In daily operation, I believe that many people have doubts about the working principle of common load balancing algorithms. I have consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what is the working principle of common load balancing algorithms?" Next, please follow the editor to study!
Polling
As the name implies, requests are distributed sequentially to the back-end servers, which treats each server evenly, regardless of the actual number of connections to the server and the current system load.
Advantages and disadvantages: the server requests the same data and the server pressure is different, so it is not suitable to be random according to the server configuration.
Through the random algorithm of the system, one of the servers is randomly selected for access according to the list size of the back-end servers. According to the theory of probability and statistics, with the increase of the number of client calls to the server, the actual effect is more and more close to the average allocation of calls to each server at the back end, that is, the result of polling.
The advantages and disadvantages of using a simple server have different pressures, so it is not suitable for source address hashing according to different server configurations.
The idea of source address hashing is that according to the IP address of the client, a value calculated by the hash function is used to modulo the size of the server list, and the result is the serial number of the server to be accessed by the customer server. The source address hash method is used for load balancing. Clients with the same IP address will be mapped to the same backend server for access every time when the list of backend servers remains unchanged.
The advantages and disadvantages will forward requests from the same IP address to the same server during the same session period, and achieve session stickiness. When the target server goes down, the weighted polling method will be lost in the session.
Different back-end servers may not have the same machine configuration and current system load, so their resilience is also different. Machines with high configuration and low load are configured with higher weights to handle more requests, while machines with low and high loads are assigned lower weights and lower system load. Weighted polling can handle this problem well and assign requests sequentially and according to weights to the backend.
The relative complex weighted random method is used to adjust the number of requests of the forwarding server according to the weight.
Like the weighted polling method, the weighted random method allocates different weights according to the configuration of the back-end machine and the load of the system. The difference is that it requests back-end servers randomly according to weight, not in order.
Minimum number of connections method
The minimum number of connections algorithm is flexible and intelligent. Because the configuration of the back-end server is different, the processing of the request is fast and slow. According to the current connection situation of the back-end server, dynamically select the server with the least backlog of connections to deal with the current request, improve the utilization efficiency of the back-end service as much as possible, and will be responsible for reasonable diversion to each server.
Advantages and disadvantages according to the current request processing of the server, the implementation of the dynamic allocation algorithm is relatively complex, and it is necessary to monitor the number of server request connections, so the study on "what is the working principle of common load balancing algorithms" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.