fair - simple TCP load balancing service
fair 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.
fair 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 fair to service HTTP
connections and to distribute them over back-ends in the 192.168.1.0/24
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:
carrousel(8), transponder(8), fair.conf(5)