HA and load balancing in linux


  • last version: 29/10/2010
  • load balancer for HTTP and TCP
  • client-side-keepalive
  • TCP speedups
  • RDP protocol compatible
  • source-based stickiness
  • stats interface
  • health checks
  • HTTP auth
  • server management via CLI
  • ACL based persistence
  • Log analyzer
  • Transparent proxy
  • Content inspection
  • App cookies
  • Hot-reconfig


  • last update: 6/5/2010
  • HA and health check
  • hot-standby protocol
  • uses VRRP for VIP


  • last update: Abr/2010
  • HA and health check
  • host-standby
  • part of LVS project


  • last update: 28/12/2007
  • HA and health check
  • host-standby
  • manages a pool of balanced IPs, no only a VIP
  • part of LVS

ldirectord is a daemon to monitor and administer real servers in a LVS cluster of load balanced virtual servers. ldirectord typically used as a resource for Linux-HA , but can also be run from the command line. ldirectord monitors the health of the real servers by periodically requesting a known URL and checking that the response contains an expected response. If a real server fails then the server is removed and will be reactivated once it comes back on line. If all the real servers are down then a fall-back server is inserted into the pool, which will made quiescent one of the real web servers comes back on line. Typically, the fall-back server is localhost. If an HTTP virtual service is being provided then it is useful to run an Apache HTTP server that returns a page indicating that the service is temporarily inaccessible.

  • only for BSD
  • strong & robust health-check framework
  • implementing a Hot Standby protocol
  • daemon that provides cluster infrastructure (communication and membership) services to its clients
  • permit know about the presence (or disappearance!) of peer processes on other machines and to easily exchange messages with them.
  • needs to be combined with a cluster resource manager (CRM) which has the task of starting and stopping the services (IP addresses, web servers, etc.) that cluster will make highly available
  • Pacemaker is the preferred cluster resource manager for clusters based on Heartbeat.
  • The CRM (a.k.a Pacemaker) is a Cluster Resource Manager which implements the cluster configuration provided by the user in CIB (Cluster Information Base). The CIB is a set of instructions coded in XML. Editing the CIB is a challenge, not only due to its complexity and a wide variety of options, but also because XML is more computer than user friendly.
  • monitoring
  • Wackamole is an application that helps with making a cluster highly available. It manages a bunch of virtual IPs, that should be available to the outside world at all times. Wackamole ensures that a single machine within a cluster is listening on each virtual IP address that Wackamole manages. If it discovers that particular machines within the cluster are not alive, it will almost immediately ensure that other machines acquire these public IPs. At no time will more than one machine listen on any virtual IP. Wackamole also works toward achieving a balanced distribution of number IPs on the machine within the cluster it manages.
  • Spread is an open source toolkit that provides a high performance messaging service that is resilient to faults across local and wide area networks. Spread functions as a unified message bus for distributed applications, and provides highly tuned application-level multicast, group communication, and point to point support. Spread services range from reliable messaging to fully ordered messages with delivery guarantees.

A LVS cluster consists or one or more virtual services each of which may have zero or more real servers. The IP address of a virtual service is what end-users connect to and is typically advertised over DNS. When a connection is made to a virtual service, it is allocated a real server, and all packets for this connection are forwarded to this real server.

  • TCP/IP and UDP/IP connections to be load balanced
  • Layer 4 Switching as information available
  • layer 3 is used to make load balancing decisions.
  • Heartbeat is the core: messages are sent at regular intervals between machines and if a message is not received from a particular machine then the the machine is assumed to have failed and some form of evasive action is taken
  • heartbeat starts up master node sets up an interface for a virtual IP address
  • IP Address Takeover: If this node fails then another node in the heartbeat cluster will start up an interface for this IP address and use gratuitous ARP to ensure that all traffic bound for this address is received by this machine
  • Each virtual IP address is considered to be a resource
  • the resource can be started and stopped, and its can be asked if it is running or not
  • Ultra Monkey makes use of heartbeat on linux-directors to mangage IP addresses and monitor real-servers using the IPaddr2 resource and ldirectord running as a resource respectively.
  • networking/ha-balancing.txt
  • Last modified: 2012/06/06 10:14
  • (external edit)