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
An expensive but, very good solution is the Cisco (ex Arrowpoint?) CSS 11000.
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.
have something similar, I remember reading something about slashdot's host setup
http://mailman.ds9a.nl/mailman/listinfo/lartc
The combination of these should get you started.
You are being MICROattacked, from various angles, in a SOFT manner.
It just works:
http://www.backhand.org/
Or, failing that, go buy a Cisco CSS11500-series box for lots of $$$.
;>
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe =utf-8&q=Linux+load+balancer
I'm going out on a limb here, not knowing a lot about networking or Linux, or RAID for that matter.
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 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.
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.
If its just web, take a look at lbnamed, a load balancing name server. They use it at Stanford with some sucess to redirect new connections to the machine with the lowst load (based on system load and users logged in).
--
Hey, atleast I don't wash your car windows while your at a stop light, then beg for karma.
symetrix. We are building a religion, a limited edition.
A load-blanenced beowulf cluster of thes.... wait a minute.
symetrix. We are building a religion, a limited edition.
If you are using PHP, you can keep session state across multiple servers two ways.
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.
there is a patch to iptables which does some load balancing ; it looks really cool : http://netfilter.samba.org/documentation/pomlist/p om-base.html#nth
We have a "front-page" server. That server randomizes links to
c a
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.
Let's not stir that bag of worms...
Speed! DO you need load balancing or do you need redundacy. There are several, pretty good, Linux solutions that have already been mentioned. But, these solutions all have a significant limitation. Processing power is that limitation. They can provide the redirection necessary for redundancy but they will suffer if your goal is truely load balancing for performance reasons.
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!
go look on ebay for a "1 public many private" switch.
vodka, straight up, thank you!
Is there any product/solutions that will have balancing the load on a multihome internet setup? any help would be greatly appericated.
Check out SiteBalancer from TGN Software.
www.ipfilter.org
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