| Have you looked into the Linux Virtual Server project? It does what you’re looking for, all licensed under the GPL.
Potato did have some LVS packages a while ago, but they’re a bit out of date now. At work, we have a 400MHz Celeron with 64mb of RAM acting as a director for 4 load-balanced Web servers. The Director is a stock Potato installation w/ a 2.4kernel patched for IPVS.
The project offers great documentation, but the just of it is this:
All you need to do to get a quick-n-easy Load balancing setup up and running is this:
1. Compile kernel (2.2 or 2.4, your choice)
2. Configure the Director to forward IP’s for your Real Servers
3. Change the default gateway on the Real Servers to route through the Director
4. Use the following commands (To your suiting)
ipvsadm -A -t director.myserver.com:www -s rr
ipvsadm -a -t director.myserver.com:www -r www1.myserver.com:www -m
ipvsadm -a -t director.myserver.com:www -r www2.myserver.com:www -m
With that, you have round-robbin load balancing setup. You mention that you need persistence handling as well: For that, simply change the ‘-s rr’ in the first ipvsadm command to ‘-p’. With that, ipvs will keep the user with the same server at least as long as one connection is still open (TIME_WAIT).
You can then setup your own customized heartbeat setup, or use some of the pre-made scripts (UltraMonkey, etc) from the LVS to remove unavailable Real Servers from the pool dynamically.
We’ve been using this setup for a long time now, and I can vouch for it’s stability. Using the LVS-NAT solution above, you should be able to get full 100MB/s throughput on the Director w/ a 300+MHz x86 processor.