Slashdot Mirror


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.

35 comments

  1. A great site by afay · · Score: 1, Informative

    Check out the High-Availability Linux Project. There's a lot of info in the site and links to much more.

    --
    Best slashdot comment
    1. Re:A great site by The+Mayor · · Score: 5, Informative
      High availability should not be confused with handling load. High availability ensures uptime for a server. Load balancing distributes a load across multiple servers, allowing the handling of larger loads. Linux-HA is for the former.

      Here are some links to some load balancing projects I'm aware of:

      • lbnamed - A load balancer written in Perl
      • Super Sparrow - A Linux-based load balancer
      • Ultra Monkey - A high-availability and load balancer solution based on Linux (it looks like Super Sparrow may be Ultra Monkey's load balancer)
      • LVS - A high-availability and load balancer solution based on Linux
      I've never used any of these, so I can't give any first-person accounts as to their effectiveness. This list isn't meant to be exhaustive, either. It's just a starting point.
      --
      --Be human.
  2. Cisco CSS 11000 by El+Micko · · Score: 1, Troll

    An expensive but, very good solution is the Cisco (ex Arrowpoint?) CSS 11000.

  3. Linux Virtual Server Project by Jason+H.+Smith · · Score: 5, Informative

    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.

    1. Re:Linux Virtual Server Project by millisa · · Score: 1

      LVSP is one I hadn't run across, I definitely appreciate the references. These how-to's are going to make some great weekend reading (ie, I haven't read them yet), did you run across anything in them that had something that actually inspected the request coming in? (this is not the most important aspect, but I would love to be able to redirect either servers looking for robots.txt or a known set of spider IP's to a specific box).

    2. Re:Linux Virtual Server Project by malice95 · · Score: 3, Informative

      LVS itself doesnt have the capability of looking into the contents of the packets it is directing. It is a layer 4 load balancer, hence it has no understanding of the http protocol. You will need to look into KTCPVS or DRWS for a layer 7 balancer that can inspect urls. This web page should give you all the details.

  4. Doesn't Slashdot ... by mfos.org · · Score: 2

    have something similar, I remember reading something about slashdot's host setup

    1. Re:Doesn't Slashdot ... by Anonymous Coward · · Score: 0

      Slashdot uses (IIRC) Cisco Arrowpoints for it's Load Balancing (ala CSS 11000)...

      Remember, with an Arrowpoint...
      You buy the Arrowpoint, and get the shaft for free.

  5. Check out netfilter & lartc by SpaceLifeForm · · Score: 1
    --
    You are being MICROattacked, from various angles, in a SOFT manner.
  6. Try mod_backhand. by Mordant · · Score: 2, Interesting

    It just works:

    http://www.backhand.org/

    Or, failing that, go buy a Cisco CSS11500-series box for lots of $$$.

    ;>

  7. Something like RAID0 but for networks... by man_ls · · Score: 1, Interesting

    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?

    1. Re:Something like RAID0 but for networks... by Anonymous Coward · · Score: 0

      A good try but the question is about balancing loads between systems not local hard drives.

    2. Re:Something like RAID0 but for networks... by Anonymous Coward · · Score: 0

      Well, this solution would be good for saturating a computer with enough data. If the bottleneck was there then this would be a good idea.

  8. Pound by mwr · · Score: 2, Interesting

    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.

  9. You want to use lvs by malice95 · · Score: 3, Informative

    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.

  10. Foundry by austad · · Score: 5, Informative

    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
  11. Re: Ultra Monkey is based on LVS by SwellJoe · · Score: 4, Informative

    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.

  12. load balancing name server by arrow · · Score: 1

    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.
  13. Can you imagine.... by arrow · · Score: 1

    A load-blanenced beowulf cluster of thes.... wait a minute.

    --
    symetrix. We are building a religion, a limited edition.
  14. Session State - PHP by new-black-hand · · Score: 1

    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.

  15. patch to iptables by node3667 · · Score: 1

    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

  16. What we do... by JMZero · · Score: 2

    We have a "front-page" server. That server randomizes links to

    server1.poop.ca
    server2.poop.ca
    server3.poop.c a

    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...
  17. The problem here is.... by FreeLinux · · Score: 1

    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!

    1. Re:The problem here is.... by ajvtoo · · Score: 2, Insightful
      One of the projects I'm involved in is the JANET Web Cache Service which is a top level proxy service for the UK academic community.

      We use LVS 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.

    2. Re:The problem here is.... by krismon · · Score: 1

      when I worked at a certain huge company that everyone hates... we had cisco localdirectors that had (1)PIII-450 CPU's in them.. we found that by opening up the box(thus breaking warranty), upgrading BIOS & CPU(to 600, this was back in '99), we got 30% more traffic thru the same box... processing power is the limitation, but, that's not to say that some of these commercial boxes from CISCO and the like are not PC based... They look just like any other box on the inside, except they had an ISA card with a flash rom that had their software on it.

      F5 BIG/IP's are BSDI boxen, etc.etc.

  18. don't reinvent the wheel by Triumph+The+Insult+C · · Score: 0

    go look on ebay for a "1 public many private" switch.

    --
    vodka, straight up, thank you!
  19. just wondering.... by krazy1 · · Score: 1

    Is there any product/solutions that will have balancing the load on a multihome internet setup? any help would be greatly appericated.

  20. Site Balancer.... by Anonymous Coward · · Score: 0

    Check out SiteBalancer from TGN Software.

  21. IP filter by nbvb · · Score: 2

    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