Title Index
Reason for traceability
Export structure
Scheduling algorithm
Problem handling
Reason for traceability
According to colleague feedback: education Cloud Platform Server external service request imbalance, one server external service volume is much larger than other servers, the problem of locking occurs in the export Load Balancer Scheduler scheduling algorithm, in order to organize operation and maintenance small team to re-enter learning load Balancing scheduling algorithm, Solve the load imbalance situation.
Export Structure
Export using two deep convincing application delivery to do load balancing, Xia Lian DP8000 security firewall to do transparent transmission, the core uses two h3c10508 to do the exchange, export network topology structure such as:
650) this.width=650; "src=" Https://s2.51cto.com/oss/201710/24/8ab6e395db06da732d01b5b3c19ad34d.jpg "title=" Load balancer. jpg "alt=" 8ab6e395db06da732d01b5b3c19ad34d.jpg "/>
Figure 1-1 Export network topology diagram
Two load Balancing master mode, firewall and core switch virtual machine technology, respectively, 1 logical firewalls and 1 logical switches, and dual main mode, in case of export load balancing at any time business switching.
Scheduling algorithm
Considering that most of the domestic products based on open source software for two of development, it is decided to trace from the open-source product LVS scheduling algorithm based on deep learning, and the learning method and problem-solving case record knowledge base.
From static and dynamic angle, the LVS scheduling algorithm is divided into 4 static scheduling algorithms and 6 dynamic scheduling algorithms, the static scheduling algorithm is relatively simple, does not depend on the server performance and the number of connections to dispatch, dynamic algorithm according to the online visit to provide service connection number and performance of dynamic scheduling, As long as the indicator parameter calculates the value of Overhead=value by the corresponding scheduling algorithm formula, the smaller value indicates the smaller the server load, therefore the priority is dispatched.
the static scheduling algorithm is as follows:
1. Polling scheduling algorithm
The polling scheduling algorithm does not consider the server performance and the number of online connections, the Fool-type polling scheduling.
2. Weighted polling algorithm
based on the weight of polling scheduling, the performance of the server can be weighted based on the weight of polling scheduling.
3. Source IP hash Algorithm
According to the source IP address hash calculation, for the same source IP address of the request or the established connection dispatched to the same server, can achieve session binding, but based on the status of domestic network, n multi-user share the same public IP address Internet request scheduling to the same server, It is possible to cause a severe imbalance in server load.
4. Destination IP hash Algorithm
Based on the destination IP to hash calculation, for the same destination IP address of the request or established connection to the same destination server, taking into account the status of domestic network, the majority of user operators or CDN content Publishers, the use of caching mechanisms to provide users with the request for acceleration services.
The dynamic scheduling algorithm is as follows:
In the dynamic scheduling algorithm, we know several concepts in advance:
Activeconns: Refers to the number of active connections, that is, a connection that is already established in the establish state.
Inactiveconns: Refers to the number of inactive connections, that is, a connection outside the TCP establish state, such as SYN_RECV, time_wait, and so on.
5. Minimum connection scheduling algorithm
Minimum connection scheduling algorithm, referred to as Lc,least Connections, the formula is: Overhead=activeconns*256+inactiveconnns, by the calculation formula, A small number of overhead that have been established in the number of server cluster nodes are also smaller, and are therefore prioritized. The scheduling calculation can be understood as "regardless of the cluster server node performance, only based on the number of server connections to provide services, the fewer connections, the priority will be dispatched."
6. Weighted least-Connection scheduling algorithm
abbreviation: wlc,weighted Least Connections, in LVS as the default policy, its specific scheduling algorithm and the meaning of the schedule is explained as follows:
On the basis of the least-connected scheduling algorithm, the weighted weight is calculated as:overhead= (Activeconns*256+inactiveconnns)/weight, which is known by the formula, The greater the weight in the number of server cluster nodes, the smaller the overhead value. The scheduling algorithm can be understood as "consider the server node performance, based on the number of server connections to provide services, the fewer connections, the greater the weight, priority will be dispatched."
7. Initial connection high weight priority
Abbreviation: Sed,shortest expection Delay, its calculation formula is: overhead= (activeconns+1) *256/weight, by the formula to know in load balancing scheduling, the higher the weight priority Overhead value, the smaller The higher the priority is called. The problem is that when the number of connections is relatively small, it is possible that only high-weight servers are available for external service and other servers are idle.
8. No Queue scheduling algorithm
Abbreviation: Nq,never Queue, in the first round of scheduling balanced scheduling, followed by the SED scheduling algorithm, to prevent only one high-performance server to provide services, while the other servers in idle state.
9. Dynamic DH algorithm
Abbreviation: lblc:locality-based LC, dynamic load balancing based on the destination IP, can be used to implement the forward proxy according to the load status, mostly used in the cache cluster, when the LVS received the request, the algorithm according to the recent transfer situation to the nearest server, If the server is available and not overloaded, send the request to the server, if the server does not exist, or if the server is overloaded and has a server in half of the workload, use the principle of "least link" to select an available server and send the request to that server
10. Dynamic DH algorithm + copy function
Abbreviation: LBLCR:LBLC with Replication, on the basis of the dynamic DH algorithm, it differs from the LBLC algorithm in that it maintains a mapping from a destination IP address to a set of servers. While the LBLC algorithm maintains a mapping from a destination IP address to a server, the algorithm finds the server group corresponding to the target IP address according to the target IP address of the request, selects a server from the server group according to the principle of "minimum connection", and sends the request to the server if it is not overloaded, if the server is overloaded, press The "minimum Connection" principle selects a server from this cluster, joins the server to the server group, sends the request to the server and, when the server group has not been modified for some time, removes the busiest server from the server group to reduce the degree of replication.
Problem handling
The principle of integrated transfer algorithm and the factors of session management, it is estimated that the implementation engineers consider the problem of the session binding, so the scheduling algorithm strategy set location static source IP hash algorithm, and the platform traffic is mostly from several fixed source IP address, so the server external service imbalance.
Connect with cloud Platform developers, the cloud platform has long supported session synchronization (Session synchronization: Session binding, session synchronization, session unification Management), so just change the load balancing scheduling algorithm to the default WLC policy to achieve server load balancing.
This article from the "one-step printing, printing for the certificate" blog, declined to reprint!
Load Balancing scheduling algorithm traceability