Langue: en

Version: 302912 (debian - 07/07/09)

Section: 7 (Divers)

BSD mandoc
Debian GNU/Linux


fair - simple TCP load balancing service


is a load balancer for TCP connections. It can be used to distribute incoming connections for SMTP, HTTP or any other TCP service to multiple hosts, distributing the load as evenly as possible.

consists of two daemons. The carrousel is the front-end; it keeps track of back-end hosts and their status, and forwards incoming connections to the back-ends in such a way that the load is distributed fairly. The transponder runs on the back-end hosts, it registers with the carrousel and sends it status information. The TCP connections forwarded by the carrousel are not sent to the transponder daemons but are sent directly to the desired service running on the back-end host. Both daemons share a single configuration file.


The following example shows how to set up to service HTTP connections and to distribute them over back-ends in the subnet.

The configuration file /etc/fair.conf contains the following:

 WorkerService = http
 BalancerService = http
 AllowUDP = ^192.168.1.[0-9]+$

On www.example.com the front-end server receiving the incoming HTTP connections, just run:


On each of the back-ends run:

 transponder www.example.com


carrousel(8), transponder(8), fair.conf5