Introduction to LVS and description of its scheduling algorithm

Source: Internet
Author: User

Introduction to LVS and description of its scheduling algorithm



    Virtual Server (LVS) architecture, A group of servers are interconnected via a high-speed LAN or geographically distributed WAN, with a load scheduler at their front end ( load Balancer ). The load scheduler can seamlessly dispatch network requests to real servers, which makes the structure of the server cluster transparent to the customer, and the network services provided by the client access to the cluster system are like accessing a high-performance, highly available server. The client program is not affected by the server cluster and requires no modification. The scalability of the system is achieved by transparently joining and deleting a node in the service cluster to achieve high availability by detecting node or service process failures and correctly resetting the system. Because our load scheduling technology is in the linux Span style= "font-size:16px;font-family: ' The song body '; color: #000000;" > In the kernel, what we call linux Span style= "font-size:16px;font-family: ' The song body '; color: #000000;" > Virtual server ( linux Virtual server


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/73/E3/wKiom1YJC9SAi9jYAADQBZiOqYE656.jpg "title=" 11111111111111111111.jpg "alt=" Wkiom1yjc9sai9jyaadqbzioqye656.jpg "/>







In the implementation of scheduler technology, IP load Balancing technology is the most efficient. In the existing IP load balancing technology, a set of servers are made up of a high-performance, high-availability virtual server through Network address translation (Addresstranslation), which we call Vs/nat technology (virtual server via Network Address translation), most commercially available IP load Balancer Scheduler products Use this method, such as Cisco's LocalDirector, F5 big/ip, and Alteon acedirector. On the basis of analyzing the disadvantage of vs/nat and the asymmetry of network service, we propose the method of implementing virtual server through IP tunneling Vs/tun (virtual server via IP tunneling), and the method of implementing the dummy server through direct routing vs/ DR (Virtual Server via Direct Routing), which can greatly improve the scalability of the system. So, the Ipvs software implements these three IP load balancing techniques, which are roughly the same as the following (we'll describe in detail how they work in other chapters),

Virtual Server via Network Address translation (Vs/nat)

Through the network address translation, the scheduler rewrites the target address of the request message, assigns the request to the backend real server according to the preset scheduling algorithm, and the response message of the real server passes through the scheduler, the source address of the message is rewritten and returned to the customer to complete the load scheduling process.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/E3/wKiom1YJDIHDweU-AADy0-CQsaw969.jpg "title=" 2222222222222222.jpg "alt=" Wkiom1yjdihdweu-aady0-cqsaw969.jpg "/>

Virtual Server via IP tunneling (Vs/tun)

When using NAT technology, because the request and response packets must be rewritten by the dispatcher address, the processing power of the scheduler becomes a bottleneck when the customer requests are more and more. To solve this problem, the scheduler forwards the request message through the IP tunnel to the real server, and the real server returns the response directly to the client, so the scheduler only processes the request message. Since the General Network Service response is much larger than the request message, the maximum throughput of the cluster system can be increased by 10 times times with Vs/tun technology.

Virtual Server via Direct Routing (VS/DR)

VS/DR by overwriting the MAC address of the request message, the request is sent to the real server, and the real server returns the response directly to the customer. As with Vs/tun technology, VS/DR technology can greatly improve the scalability of the cluster system. This method does not have the overhead of IP tunneling, and there is no need to support the IP tunneling protocol for real servers in the cluster, but requires that the scheduler and the real server have a NIC attached to the same physical network segment.


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/E3/wKiom1YJDJjz2vPHAAFzdjCjBso273.jpg "title=" 33333333333333333333.jpg "alt=" Wkiom1yjdjjz2vphaafzdjcjbso273.jpg "/>

For different network service requirements and server configuration, the Ipvs Scheduler implements the following eight load scheduling algorithms:

Call (Round Robin)

The scheduler uses the "round-robin" scheduling algorithm to sequentially allocate external requests to real servers in the cluster, and treats each server equally, regardless of the actual number of connections and system load on the server.

Weighted round call (Weighted Round Robin)

The scheduler uses the "Weighted round call" scheduling algorithm to schedule access requests based on the different processing capabilities of the real server. This ensures that the processing capacity of the server handles more access traffic. The scheduler can automatically inquire about the load of the real server and adjust its weights dynamically.

Minimum link (Least Connections)

The scheduler dynamically dispatches network requests to the server with the fewest number of links established through the "least connection" scheduling algorithm. If the real server of the cluster system has similar system performance, the "Minimum connection" scheduling algorithm can be used to balance the load well.

Weighted least link (Weighted Least Connections)

In the case of the server performance difference in the cluster system, the scheduler uses the "Weighted least link" scheduling algorithm to optimize the load balancing performance, and the server with higher weights will bear a large proportion of active connection load. The scheduler can automatically inquire about the load of the real server and adjust its weights dynamically.

Minimal links based on locality (locality-based Least Connections)

" The least-link scheduling algorithm based on locality is load-balanced for target IP address, and is mainly used in cache cluster system. According to the target IP address of the request, the algorithm finds the most recently used server, if the server is available and not overloaded, sends the request to the server, if the server does not exist, or if the server is overloaded and has half of the workload of the server, the principle of "least link" is used to select an available server. , the request is sent to the server.

Local least-link with replication (locality-based Least Connections withreplication)

" Local least-link scheduling algorithm with replication is also load balanced for target IP address, and is mainly used in cache cluster system. 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. According to the target IP address of the request, the algorithm finds the corresponding server group of the target IP address, selects a server from the server group according to the principle of "minimum connection", if the server is not overloaded, sends the request to the server, if the server is overloaded, select a server from this cluster according to the "minimum connection" principle. Join the server to the server group and send the request to the server. Also, when the server group has not been modified for some time, the busiest server is removed from the server group to reduce the degree of replication.

Destination Address hash (Destination Hashing)

" The target address hash "scheduling algorithm based on the destination IP address of the request, as a hash key (hash key) from the static distribution of the hash list to find the corresponding server, if the server is available and not overloaded, send the request to the server, otherwise return empty.

Source Address hash (source Hashing)

" The source address hash "Scheduling algorithm is based on the requested source IP address, as a hash key (hash key) from the static distribution of the hash list to find the corresponding server, if the server is available and not overloaded, send the request to the server, otherwise return empty.






This article is from the "Technical Achievement Dream" blog, please be sure to keep this source http://pizibaidu.blog.51cto.com/1361909/1698894

Introduction to LVS and description of its scheduling algorithm

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.