fair(7)

πŸ¦‹ fair(7) β€” the manual page, but make it bestie-coded πŸ¦‹

okay so. fair β€” simple TCP load balancing service. that's the whole vibe, but let me break it down for you because it's actually so much cooler than it sounds. πŸ’…


✨ NAME ✨

fair β€” simple TCP load balancing service 🫢


🌸 DESCRIPTION 🌸

okay so fair is a load balancer for TCP connections. what that means is: it takes incoming connections β€” for SMTP, for HTTP, or literally any other TCP service β€” and spreads them across multiple hosts, distributing the load as evenly as possible. no cap. that's the whole job. ✨

fair is made up of two daemons, and they have distinct main character energy:

  • The carrousel β€” this is the front-end. it keeps track of back-end hosts and their status, and it forwards incoming connections to the back-ends in such a way that the load gets distributed fairly. πŸ‘‘
  • The transponder β€” this one lives on the back-end hosts. it registers with the carrousel and sends it status information. it's the little messenger bestie keeping everyone in the loop. πŸŽ€
🚨 okay important plot twist: the TCP connections forwarded by the carrousel are not sent to the transponder daemons. they go directly to the desired service running on the back-end host. the transponder is just there for the status gossip, it is NOT proxying your traffic. don't get it twisted. πŸ’€

and the final cute detail: both daemons share a single configuration file. one file, two daemons, iconic. 🌈


πŸ“ EXAMPLES πŸ“

here's how you'd set up fair to service HTTP connections and distribute them over back-ends in the 192.168.1.0/24 subnet. watch this. πŸ”₯

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:

carrousel

and on each of the back-ends run:

transponder www.example.com

that's it. that's the setup. go forth and balance. πŸ¦‹


πŸ’œ SEE ALSO πŸ’œ


and that's the page bestie!! this one's from Debian GNU/Linux, dated 2005-05-25 β€” vintage but still eating, fr fr. ily, go balance some TCP πŸ’–βœ¨