LVS - Linux Virtual Server - High Availability Clusters and Redundant Server Pairs

Load Balancing

Load balancing allows us to use medium-scale hardware working together instead of expensive, power consuming large-scale hardware to quickly service requests. By using Ultra Monkey we are able to cluster webservers together so that multiple real servers service requests from the end-user while appearing to be one server (virtual server). UltraMonkey uses several open source projects to accomplish this task. Namely, Linux Virtual Server (LVS), Heartbeat, and Ldirectord.

Linux Virtual Server

Linux Virtual Server (LVS) is the component that determines what real server in the cluster is going to handle the request sent to the virtual server. There are three methods that LVS can use to do this. Network Address Translation, IP Tunneling, and Direct Routing.

The Network Address Translation (NAT) method works in an environment where there are limited public addresses available, or public addresses are undesirable due to security reasons. In this scenario the load balancer will have a public address while the real servers in the cluster have private addresses (i.e. or When the load balancer receives a request, it re-writes the destination of the request from itself to one of the real servers.

IP Tunneling is similar to NAT in application. The difference is the request packet is wrapped in an IP datagram and sent to the real server instead of rewriting the destination address. The real server strips off the wrapping and services the request. This method allows for the real servers in the cluster to have non-private IP addresses, or even be in different in different networks.

Direct Routing has the load balancer and the real servers sharing the virtual IP address through a physical connection (switch). The load balancer receives the request and forwards it to a chosen real server, the real server then uses another network interface to respond directly to the end-user.


Ldirectord is typically used as a resource for Heartbeat. Ldirectord monitors the "health" of the real servers by periodically requesting a known URL and checking to see that it sends the anticipated response. If a real server in the cluster fails it gets removed from the cluster until comes back online.

Who’s Using This Technology?

We here at Base 2 Companies are not the only ones using this technology. Real Networks, Inc., makers of the Real One Player, use LVS to deploy a 20+ node of media servers. The UK National JANET Web Cache Service has 40 Squid Cache servers in three LVS clusters, serving up ~900GB of content per day. The LVS deployment page contains many more examples.

base2co • Buffalo NY •

Copyright ® 2011-2021 Joseph T. Buscaglia

Last Modified 07/23/17

Valid XHTML 1.0 Strict