Basic load balancing Algorithms

Source: Internet
Author: User

Basic load balancingAlgorithm, Mainly including the following (refer to F5 products ):

    • Random: The Load Balancing Method Randomly distributes the load to each available server, selects a server through the random number generation algorithm, and sends the connection to it. Although many balancing products support this algorithm, its validity has been questioned unless the server running time is very important.
    • Round robin: the round robin algorithm allocates each new connection request to the next server in order, and finally distributes all requests equally to all servers. The polling algorithm works well in most cases. However, if the server Load balancer device is not completely equal in terms of processing speed, connection speed, and memory, the effect will be better.
    • Weighted Round Robin (WRR): In this algorithm, the number of connections accepted by each machine is allocated by weight ratio. This is an improvement to the general round-robin algorithm. For example, you can set that the processing capability of the third machine is twice that of the first machine, the server Load balancer allocates two times the number of connections to 3rd machines.
    • Dynamic round robin: similar to Weighted Round Robin (WRR). However, the weight value is based on the continuous monitoring and updating of each server. This is a dynamic load balancing algorithm that distributes connections based on real-time server performance analysis, such as the current number of connections per node or the fastest response time of the node.
    • Fastest algorithm: the fastest algorithm allocates connections based on the fastest response time on all servers. This algorithm is particularly useful for servers across different network environments.
    • Least connections: The system allocates new connections to the server with the least number of connections currently. This algorithm is very effective in environments with similar computing capabilities on each server.
    • Observation algorithm: This algorithm uses the minimum connection algorithm and the fastest algorithm to implement load balancing at the same time. The server gets a score based on the number of current connections and response time. A higher score indicates better performance and more connections will be obtained.
    • Prediction Algorithm: This algorithm uses the observation algorithm to calculate scores. However, the prediction algorithm analyzes the score change trend to determine whether the performance of a server is improving or decreasing. More connections will be established for servers with improved trends. This algorithm applies to most environments.

Performance TuningCommunityDynatrace shared the customer case in his blog. e-commerce websites collapsed several times during the holiday peak traffic period and solved the problem through SQL optimization and adjustment of the load balancing algorithm. first, analyze and execute the slowest database statements, and optimize the performance, such as adding indexes. At the same time, the size of the connection pool is optimized to meet the needs during peak hours. Then, enterprises change the Server Load balancer algorithm from round-robin to least-busy.

RelatedArticle:

Case study of e-commerce website downtime

ASP. NET session state partitioning

ASP. NET session state Partitioning Using state server load balancing

Parsing nginx Server Load balancer

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.