Simple DIY Linux/BSD based Network Balancers? 35
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.
A great site (Score:1, Informative)
Re:A great site (Score:5, Informative)
Here are some links to some load balancing projects I'm aware of:
Re: Ultra Monkey is based on LVS (Score:4, Informative)
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.
just wondering.... (Score:1)
Cisco CSS 11000 (Score:1, Troll)
Linux Virtual Server Project (Score:5, Informative)
We have recently done just this using the Linux Virtual Server Project [linuxvirtualserver.org], 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 [kernel.org] 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 [linuxvirtualserver.org].
Re:Linux Virtual Server Project (Score:1)
Re:Linux Virtual Server Project (Score:3, Informative)
Doesn't Slashdot ... (Score:2)
Check out netfilter & lartc (Score:1)
http://mailman.ds9a.nl/mailman/listinfo/lartc [ds9a.nl]
The combination of these should get you started.
Try mod_backhand. (Score:2, Interesting)
http://www.backhand.org/
Or, failing that, go buy a Cisco CSS11500-series box for lots of $$$.
;>
Something like RAID0 but for networks... (Score:1, Interesting)
My understanding of (2-disk) RAID0 is that blocks are written alternating between drives. A simple shell script or very simple program should be able to simply alternate connections...However, as everyone knows, just because the number of connections are equal doesn't mean the loads are the same. There'd need to be checking for which one has more slots left, which has a higher workload, etc.
Maybe SNMP would come into play here somewhere?
Pound (Score:2, Interesting)
Pound [apsis.ch] is a simple http/https load balancer that's been announced fairly frequently on the Zope mailing list. It appears to be very small, runs diskless and chrooted, and handles back-end servers dropping off and coming back.
You want to use lvs (Score:3, Informative)
Comment removed (Score:5, Informative)
load balancing name server (Score:1)
--
Hey, atleast I don't wash your car windows while your at a stop light, then beg for karma.
Can you imagine.... (Score:1)
Session State - PHP (Score:1)
1. If you are using file based session storage, in your php.ini set the session save path to a NFS share on one server.
2. (recommended) PHP has support to use a MySQL database to store session information, you could run a single database server to store all session information.
patch to iptables (Score:1)
What we do... (Score:2)
server1.poop.ca
server2.poop.ca
server3.poop.
etc... If we need to take a server down, we just reroute its traffic to another server (and we usually have a free one).
I suppose this doesn't help if you've got too much front page traffic for one server, nor is it a perfect solution in any case. But it's really easy to implement, and works just fine for us.
The problem here is.... (Score:1)
While it is straight forward enough to perform layer 7 redirecting, if your load is such that it will crush IIS or Apache, then putting a single box with a single or dual CPU in front of the web servers won't help much as this box will then become the bottle neck.
The "expensive" layer 4-7 switches that you mentioned are specifically designed for their function with multiple high bandwidth ports and, most importantly, one or more ASICs per port to handle the processing. This is something that Linux or any PC based load balancer cannot provide for you. Certainly if you are balancing more than a couple of ports.
So, if you want redundancy and the load isn't all that high, Linux could be the answer. But if you have a truely high load you need to look at the real deal like Nortel/Alteon or Cisco/Arrowpoint. And if you're doing SSL a hardware SSL accelerator is the ONLY way to fly!
Re:The problem here is.... (Score:2, Insightful)
We use LVS [linuxvirtualserver.org] code to load balance our squid boxen at layer 4, and have successfully shifted some 120Mbps through one of our nodes using direct routing on the backends, rather than NATing the system - this configuration barely loaded the frontend (which was only a 500MHz machine) and load balanced some 15-16 backend machines.
ISTR there is some early layer 5-7 code on the LVS site somewhere, but I've not used it, so I don't know how stable it is, or what the performance is like.
Re:The problem here is.... (Score:1)
F5 BIG/IP's are BSDI boxen, etc.etc.
IP filter (Score:2)
Updated for 3.4
New to this release (3.4) of IP Filter are the following:
Round-robin redirection to spread traffic load over multple IP addresses
Check it out..... Host-based firewalling _and_ load balancing! Joy! All as a LKM!
--NBVB