Apache HTTPD's mod_proxy_balancer

Last year we bought a Barracuda web firewall/load balancer appliance at work and have had nothing but problems with it.  Even the support guys from Barracude were unable to solve our dropped connection problems.  Needless to say, rather disappointing for a $15K device.

We're also in the process of moving off of Akamai to another CDN provider that doesn't provide all the non-CDN stuff that Akamai does (edge gzip, domain splitting, etc.).

Instead of both Barracude and Akamai we're using Apache HTTPD to do load balancing (with mod_proxy_balancer and mod_proxy_ajp), domain splitting (with mod_proxy_http), and SSL offloading (with mod_ssl).  We're going live tomorrow, but to this point everything has been remarkably smooth.  Our first load balancing set up was a little bit flawed because we were using HTTP proxying instead of AJP proxying which caused some issues with CFC-generated WSDL (because the ports showed the backend server instead of the public server).  AJP solves that problem.

I'd never used mod_proxy_balancer before, and I'm pretty impressed.  The documentation could use a little work, but the functionality is great.  There are no frills anywhere: the admin UI is a couple tables and a form (no CSS), monitoring is another HTML table, and the configuration is a couple simple directives.

At my last job we did everything with ldirectord, which is a layer 4 balancer for linux.  It worked great, but we needed a layer 7 balancer in this case for sticky sessions and such.  Further, since all our production servers are currently Windows (ick), but we're in the processes of deploying redundant linux load balancers, we wanted something that we could use on both platforms.

So if you're looking for simple layer 7 HTTP load balancing, highly recommend taking a look at Apache.  And, of course, you gain access to all the other Apache goodness, mod_rewrite in particular.  You have to be willing to edit some text files (no wizard interface), but they're reasonably straightforward, and the flexibility is fantastic.

6 responses to “Apache HTTPD's mod_proxy_balancer”

  1. denny

    Here's some information on load balancing JBoss 5 using Apache and AJP:

    http://coldshen.com/blog/index.cfm/2008/9/27/Load-Balancing-your-JBoss-AS-5-cluster-with-Apache-AJP

    I've been really happy with it too. And AJP is so much easier to use than mod_jk.

    Good stuff!

  2. Manny

    Which CDN did you move to?

  3. Geoff

    "And, of course, you gain access to all the other Apache goodness, mod_rewrite in particular."

    I was just wondering if you're running mod_rewrite upstream of your web servers using this solution?

    Currently I'm running isapi rewrite on a windows server, and have been considering a load balanced solution. Offloading the rewriting would be nice – especially as we have a large chunk of 301 redirects; no need for our webservers to ever see these requests…

  4. How can I balance incoming web traffic amongst N apache servers?

    [...] bugtussle start your quest here: http://httpd.apache.org/docs/2.1/mod/mod_proxy_balancer.html and http://www.barneyb.com/barneyblog/2009/02/26/apache-httpds-mod_proxy_balancer/ August 24, 2010 9:18 am jaq For the balancers you could look into LVS at [...]