Linux Virtual Server

From Simple English Wikipedia, the free encyclopedia
Linux Virtual Server
Original author(s)Wensong Zhang
Developer(s)et al.
Initial releaseMay 1998; 26 years ago (1998-05)
Written inC
Operating systemLinux
Typeload balancing
LicenseGNU General Public License
Websitewww.linuxvirtualserver.org

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.

LVS as used by Wikimedia Foundation in 2022.

Glossary[change | change source]

Commonly used terms include the following:[1]

  • 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[change | change source]

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 -m

The 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[change | change source]

  • IP Virtual Server
  • Netfilter and nftables
  • Network scheduler

References[change | change source]

  1. "Linux Virtual Server: Load Balance Your Networked Services". bobcares.com. 2008. Retrieved 2013-11-24.

Other websites[change | change source]