Load Balancing Overview
Load balancing is the process of distributing the load of a given service to multiple servers who ultimately handle a given request. Load balancing comes in many forms. DNS round robin is a form, albeit non-ideal, of load balancing. There are software load balancers and hardware load balancers which each serve to distribute load over many servers.
LVS Load Balancing
InterWorx-CP uses the ipvsadm load balancer provided by the Linux Virtual Server (LVS) project. It is a software load balancer that runs on Linux and FreeBSD systems and works very well as a general purpose load balancer. LVS allows for an array of load balanced setups including:
- LVS-NAT (Network Address Translation) - Load balancing with clustered nodes using NAT
- LVS-DR (Direct Routing) - Load balancing with clustered nodes on the same physical segment using publicaly routable IPs
- LVS-TUN (IP Tunneling) - Load balancing with clustered nodes over a WAN
Load Balancing in InterWorx-CP
InterWorx-CP uses the LVS-DR (Direct Routing) mechanism. It allows you to load balance servers on the same physical segment using either publically routable or internal IPs in a static NAT setup.
The load balancing works by having all nodes in the cluster share one or more IP addresses, which InterWorx-CP uses to host websites as it normall does. This sharing is managable since none of the Clustered Nodes answer ARP requests from your network infrastructure. The Cluster Manager answers any ARP requests for the clustered IP address and then decides which of the Clustered Nodes will actually be servicing the request. The Cluster Manager then forwards the request to the Node which will service it by doing a MAC address translation. This MAC translation will only function if the Clustered Nodes are on the same network segment, hence the same segment requirement.
