Linux Virtual Server

Linux Virtual Server (LVS) is load balancing software. It is for Linux kernel–based operating systems.

LVS is a free and open-source project. It has started by Wensong Zhang in May 1998. It is subjected to the requirements of the GNU General Public License (GPL), version 2. 

The mission of the project is to build a high-performance and highly available server for Linux using clustering technology, that provides good scalability, reliability and serviceability.
link=https://upload.wikimedia.org/wikipedia/commons/4/4d/Wikipedia_webrequest_2022.png|thumb|LVS as used by Wikimedia Foundation in 2022.

 Glossary 
Commonly used terms include the following:

 LVS director: load balancer that receives all incoming client requests for services and directs them to a specific "real server" to handle the request
 Real servers: nodes that make up an LVS cluster which are used to provide services on the behalf of the cluster
 Client computers: computers requesting services from the virtual server
 VIP (Virtual IP address): the IP address used by the director to provide services to client computers
 RIP (Real IP address): the IP address used to connect to the cluster nodes
 DIP (Directors IP address): the IP address used by the director to connect to network of real IP addresses
 CIP (Client IP address): the IP address assigned to a client computer, that it uses as the source IP address for requests being sent to the cluster

 Examples 
Setting up a virtual HTTP server with two real servers:ipvsadm -A -t 192.168.0.1:80 -s rr
ipvsadm -a -t 192.168.0.1:80 -r 172.16.0.1:80 -m
ipvsadm -a -t 192.168.0.1:80 -r 172.16.0.2:80 -mThe first command assigns TCP port 80 on IP address 192.168.0.1 to the virtual server.  The chosen scheduling algorithm for load balancing is round-robin (-s rr).  The second and third commands are adding IP addresses of real servers to the LVS setup.  The forwarded network packets shall be masked (-m).

Querying the status of the above configured LVS setup:# ipvsadm -L -n
IP Virtual Server version 1.0.8 (size=65536)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.0.1:80 rr
  -> 172.16.0.2:80                Masq    1      3          1
  -> 172.16.0.1:80                Masq    1      4          0

 Related pages 

 IP Virtual Server
 Netfilter and nftables
 Network scheduler

 References 

 Other websites 


 Linux Virtual Server Configuration Wiki
 IBM eServer BladeCenter, Linux, and Open Source: Blueprint for e-business on demand  (includes LVS as a component)

Category:Linux software