Simple DIY Linux/BSD based Network Balancers?
millisa asks: "I've been looking into options for inexpensive web based load balancing services for both Apache and IIS based web servers. There are plenty of commercial products out there that claim to do the job, but they are often too pricey, offer too many features, or are unreliable. I have lost the small amount of confidence I had in the MS based NLB services and do not like the idea of running multiple services on the same system anyways. I would like to build one (or more) simple front end load balancing Linux (or BSD) servers to direct traffic to the back-end systems if possible. I have seen mention of implementations based off of the Linux Router Project or the global load balancing oriented Eddie. What approaches are other geeks out there using for their LAN load balancing needs? I am especially interested in implementations that can maintain state (ie, handle sessions) as well as do some form of request inspection (so as to redirect those pesky web spiders to their own playground so a live user has the best web experience)." It's been long enough since the last time this came up, so lets revisit this question and touch upon the new solutions that have come up since 1999.
Check out the High-Availability Linux Project. There's a lot of info in the site and links to much more.
Best slashdot comment
We have recently done just this using the Linux Virtual Server Project, and it has turned out very well. Just be prepared to read a lot of documentation.
Basically, you patch a stock Linux kernel and use a tool similar to ipchains to establish virtual services. These services forward requests to your back-end real servers according to a flexible ruleset that you design.
You can use NAT to hide the real servers from the Internet if you like. This allows you to use most any web server you like (such as IIS), but more fancy routing tricks can be done with Unix or Linux servers for even better results. We use NAT at our site (university EE department) and it can handle more load than we will ever receive -- our objective is high-availability. Also, you can use different methods for different server clusters on the same director (e.g. tunneling tricks for Linux apache servers, and less magic for IIS).
And LVS can be set up such that once a user connects to a particular server, his subsequent connections go back to the same server.
Also, you can use freely-available third-party tools like Mon to watch your real servers for failure and dequeue them, page you, etc. etc. The bottom line is, since you are using Free tools to do this project, you are limited by your imagination as to what you can do with your cluster.
I have been very happy with the result. And so have many others. If you want to hear big names, LVS is used by linux.com, Sourceforge, zope.org, VA Systems, and RealNetworks, according to their deployment page.
Use Linux Virtual Server. I have 15 ldap/webservers being load balanced in 3 sites (each site of consists of 2 LVS servers in a hot/standby config) with each HA pair of lvs systems load balancing 5 servers.. if 2 or more of one sites servers go down then the site's lvs system will begin to route 20% up to 100% of the traffic to the other 2 sites. You will need to read a ton of docs but its pretty easy to setup once you get the hang of it. Its rock solid so far. I am planning on implementing them all over our company network.
If you can't find what you're looking for with Linux or BSD, take a look at the Foundry ServerIron XL. It lists for $7995, but you can pick them up used for around $3000 each. The performance is way better than you'll see with a non-ASIC based platform, and it has more features than you'll find with a *nix solution. The foundry also does Global DNS load balancing if you have multiple different datacenters. At $3000, it's around the same price as a Dell 1650, which is what you'd need if you have a high traffic site (more than 80 or 90 Mbit/sec at any one time). I've been using Foundry and F5 for quite some time, and I have to say the Foundry definitely comes out on top, both in price and performance.
FYI, F5's insanely priced products are simply a heavily modified version of FreeBSD running a modified version of Bind 8.
Need Free Juniper/NetScreen Support? JuniperForum
Ultra Monkey is a package including LVS, prepared mostly by Horms.
Super Sparrow is a distributed load balancing package also by Horms (formerly of VA Research|Linux|Software|Spacecraft|Doohickeys) that uses BGP route information to decide which server ought to service a request. Neat stuff. Super Sparrow is not ready for deployment, and appears to be on a back burner (due to VA's disinterest in such things these days, probably).
LVS is the project to beat in this space, by a long ways. It is very very solid, and extremely efficient. Wensong is quite an impressive nerd.