LVS load balancing

LVS load balancing


1. Load balancing is a technology that refers to a method of achieving load sharing through a certain algorithm. In layman's terms, it is a device that uniformly distributes requests. Load balancing will receive all requests uniformly, and then distribute these requests to all members of the load balancing group according to the set algorithm, so as to achieve balanced distribution of requests (loads). .
2. Load balancing software includes nginx, LVS, etc., and hardware implementation includes F5 and other


LVS, (Linux Virtual Server),
1. It is a cluster technology, using IP load balancing technology and content-based request distribution technology
2. Scheduling The scheduler has a good throughput rate, transfers the requests to different servers in a balanced manner, and the scheduler automatically shields the failure of the server, thereby forming a group of servers into a high-performance, high-availability virtual server. The structure of the entire server cluster is transparent to the client, and there is no need to modify the client and server side programs.
3. The LVS cluster adopts a three-tier structure
(1) Load balancer/Director, which is the front-end machine of the entire cluster to the outside, responsible for sending the client's request to a group of servers for execution, and the client thinks that the service is from an IP address (what we might call a virtual IP address).
(2) The server pool (server pool/ Realserver) is a group of servers that actually execute client requests. The services generally executed include WEB, MAIL, FTP, and DNS.
(3) Shared storage, which provides a shared storage area for the server pool, so that the server pool can easily have the same content and provide the same service.


LVS load balancing method
1. VS/NAT is the simplest method, based on the IP address hash calculation and forwarding to different servers (servers in the server pool).
2. IP tunneling is a technology that encapsulates one IP packet in another IP packet, which enables data packets destined for one IP address to be encapsulated and forwarded to another IP address. The scheduler forwards the request message to the real server through the IP tunnel, and the real server returns the response directly to the client, so the scheduler only processes the request message.
3. The VS/DR mode is implemented by rewriting the MAC address part of the request message. Director and RealServer must have a physical network card connected through an uninterrupted local area network.
4. The first request response is sent back to the client through the scheduler. Then the server directly responds to the client, and the content does not go through the scheduler, which reduces the workload of the scheduler.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326830730&siteId=291194637