Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does LVS mean?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces what LVS means. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

I. the concept of LVS

LVS is the abbreviation of Linux Virtual Server, which means Linux virtual server. This is an open source project initiated by Dr. Zhang Wensong, and its official website is http://www.linuxvirtualserver.org/. LVS is now part of the Linux kernel standard.

The technical goal that can be achieved by using LVS is to achieve a high-performance and high-availability Linux server cluster through LVS load balancing technology and Linux operating system, which has good reliability, scalability and maneuverability. As a result, the performance of * * can be realized at low cost.

LVS has been a mature project since 1998. LVS technology can be used to achieve high-performance, highly compressible network services, such as WWW services, FTP services, MAIL services and so on. The more famous are www.linux.com and www.real.com.

II. The architecture of LVS

The server cluster system built with LVS consists of three parts: the front-end load balancing layer (Loader Balancer), the middle server group layer, represented by Server Array, and the data sharing storage layer of the * layer, represented by Shared Storage. In the eyes of users, all applications are transparent, and users are just using the high-performance services provided by a virtual server.

The architecture of LVS is shown in the figure:

A detailed description of the various levels of LVS:

Load Balancer layer: it is located at the front end of the whole cluster system and is composed of one or more load schedulers (Director Server). The LVS module is installed on Director Server, while the main function of Director is similar to a router. It contains routing tables set for completing the LVS function, through which users' requests are distributed to the application server (Real Server) in the Server Array layer. At the same time, the monitoring module Ldirectord for Real Server services should be installed on Director Server, which is used to monitor the health status of each Real Server service. Remove Real Server from the LVS routing table when it is not available and rejoin it when it is restored.

Server Array layer: consists of a group of machines that actually run application services. Real Server can be one or more of WEB servers, MAIL servers, FTP servers, DNS servers, and video servers. Each Real Server is connected by high-speed LAN or distributed WAN. In practical applications, Director Server can also act as Real Server at the same time.

Shared Storage layer: a storage area that provides shared storage space and content consistency for all Real Server. Physically, it is generally composed of disk array devices. In order to provide content consistency, data can be shared through the NFS network file system, but the performance of NFS is not very good in busy business systems. At this time, you can use cluster file systems, such as Red hat's GFS file system. OCFS2 file system provided by oracle, etc.

From the whole LVS structure, we can see that Director Server is the core of the whole LVS. At present, the operating system for Director Server can only be Linux and the FreeBSD,linux2.6 kernel can support LVS functions without any settings, while there are not many applications of FreeBSD as Director Server, and the performance is not very good. For Real Server, almost all system platforms, Linux, windows, Solaris, AIX, BSD series can be well supported.

Third, the characteristics of LVS cluster

3.1 IP load balancing and load scheduling algorithm

1.IP load balancing Technology

There are many implementation schemes for load balancing technology, including DNS-based domain name rotation resolution, client-side scheduling access, application-layer system load scheduling, and IP address-based scheduling. Among these load scheduling algorithms, IP load balancing is the most efficient.

LVS's IP load balancing technology is realized through IPVS module. IPVS is the core software of LVS cluster system. Its main function is to install it on Director Server and at the same time create a virtual IP address on Director Server. Users must access the service through this virtual IP address. This virtual IP is commonly referred to as the VIP of LVS, or Virtual IP. The request for access first goes through the VIP to the load scheduler, and then the load scheduler selects a service node from the Real Server list to respond to the user's request.

When the user's request arrives at the load scheduler, how the scheduler sends the request to the Real Server node that provides the service, and how the Real Server node returns data to the user is the key technology of IPVS implementation. There are three load balancing mechanisms implemented by IPVS, namely NAT, TUN and DR, which are described in detail as follows:

VS/NAT: namely (Virtual Server via Network Address Translation)

That is, the network address translation technology realizes the virtual server. When the user request arrives at the scheduler, the scheduler rewrites the target address of the request message (that is, the virtual IP address) into the selected Real Server address. At the same time, the target port of the message is also changed to the corresponding port of the selected Real Server, and the message request is sent to the selected Real Server. After the server gets the data, when the Real Server returns the data to the user, it needs to go through the load scheduler to change the source address and source port of the message into the virtual IP address and corresponding port, and then send the data to the user to complete the whole load scheduling process. It can be seen that in NAT mode, both user request and response packets must be rewritten by Director Server addresses. When there are more and more user requests, the processing capacity of the scheduler will be called a bottleneck.

VS/TUN: namely (Virtual Server via IP Tunneling)

That is, IP tunnel technology to achieve virtual server. Its connection scheduling and management is the same as that of VS/NAT, but its message forwarding method is different. In VS/TUN mode, the scheduler uses IP tunnel technology to forward user requests to a certain Real Server, and this Real Server will directly respond to users' requests without going through the front-end scheduler. In addition, there is no requirement for the geographical location of Real Server. It can be located in the same network segment as Director Server, or it can be an independent network. Therefore, in the TUN mode, the scheduler will only deal with the user's message requests, and the throughput of the cluster system will be greatly improved.

VS/DR: namely (Virtual Server via Direct Routing)

That is to say, the virtual server is realized by direct routing technology. Its connection scheduling and management are the same as those in VS/NAT and VS/TUN, but its packet forwarding method is different. VS/DR sends the request to Real Server by rewriting the MAC address of the request message, while Real Server returns the response directly to the customer, eliminating the IP tunnel overhead in VS/TUN. This method has the performance of the three load scheduling mechanisms, but both Director Server and Real Server must have a network card connected to the same physical network segment.

2. Load scheduling algorithm

As we mentioned above, the load scheduler dynamically selects a Real Server to respond to user requests according to the load of each server, so how to implement dynamic selection? in fact, the load scheduling algorithm we are going to talk about here. According to different network service requirements and server configurations, IPVS implements the following eight load scheduling algorithms. Here we describe in detail the four most commonly used scheduling algorithms. For the remaining four scheduling algorithms, please refer to other materials.

Round-robin scheduling (Round Robin)

Round call scheduling, also known as 1:1 scheduling, the scheduler distributes external user requests to each Real Server in the cluster at 1:1 in sequence through the round call scheduling algorithm, which treats each Real Server equally, regardless of the actual load and connection status on the server.

Weighted round robin scheduling (Weighted Round Robin)

The weighted round call scheduling algorithm schedules access requests according to the different processing capabilities of Real Server. Different scheduling weights can be set for each Real Server, higher weights can be set for Real Server with relatively good performance, and lower weights can be set for Real Server with weak processing power, which ensures that servers with strong processing capacity can handle more access traffic. Make full and reasonable use of server resources. At the same time, the scheduler can automatically query the load of Real Server and adjust its weight dynamically.

Least link scheduling (Least Connections)

The minimum connection scheduling algorithm dynamically dispatches network requests to the server with the least number of established links. If the real server of the cluster system has similar system performance, the load can be better balanced by using the "minimum connection" scheduling algorithm.

Weighted least link scheduling (Weighted Least Connections)

"weighted minimum link scheduling" is a superset of "least connection scheduling". Each service node can use the corresponding weight to represent its processing capacity, and the system administrator can dynamically set the corresponding weight, the default weight is 1. Weighted minimum connection scheduling makes the number of established connections of the service node proportional to its weight as far as possible when assigning new connection requests.

The other four scheduling algorithms are locality-based minimum chaining (Locality-Based Least Connections), locality-based minimal chaining with replication (Locality-Based Least Connections with Replication), destination address hash (Destination Hashing) and source address hash (Source Hashing). The meaning of these four scheduling algorithms will not be discussed in this paper. If you want to learn more about the other four scheduling strategies, you can visit zh.linuxvirtualserver.org on the Chinese site of LVS. Check out more detailed information.

3.2 High availability

LVS is an application software based on kernel level, so it has high processing performance. The load balancing cluster system based on LVS has excellent processing capacity, and the failure of each service node will not affect the normal use of the whole system. At the same time, it can achieve reasonable load balancing, so that the application has ultra-high load service capacity and can support millions of concurrent connection requests. If you configure a 100-megabit ENI and use VS/TUN or VS/DR scheduling technology, the throughput of the entire cluster system can be as high as 1 gigabit Nic; if you configure a gigabit ENI, the * * throughput of the system can be close to 10Gbits/s.

3.3 High reliability

LVS load balancing cluster software has been widely used in enterprises, schools and other industries, and many large and key web sites at home and abroad have also used LVS cluster software, so its reliability has been well proved in practice. There are many load balancing systems based on LVS that have been running for a long time and have never been restarted. All these show that LVS has high stability and high reliability.

3.4 applicable environment

LVS only supports Linux and FreeBSD systems for front-end Director Server, but it supports most TCP and UDP protocols. Applications that support TCP protocols include: HTTP,HTTPS,FTP,SMTP,POP3,IMAP4,PROXY,LDAP,SSMTP and so on.

Applications that support UDP protocol include DNS,NTP,ICP, video and audio stream playback protocols, etc.

LVS has no restrictions on the operating system of Real Server. Real Server can run on any operating system that supports TCP/IP, including Linux, various Unix (such as FreeBSD, Sun Solaris, HP Unix, etc.), Mac/OS and Windows, etc.

3.5 Open Source Software

LVS cluster software is free software distributed under the GPL (GNU Public License) license, so users can get the source code of the software and make various modifications according to their own needs, but the modifications must be distributed in GPL.

The above is all the contents of this article "what does LVS mean?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report