Take the 2-minute tour ×

Right now we only have one back-end server per site/web service. I'd be interested to hear people's experiences with various load balancer apps (something that runs on Linux).

What would you recommend?


locked by HopelessN00b Dec 5 at 2:40


8 Answers 8

up vote 13 down vote accepted

According to the episode 27 of the StackOverflow podcast, the Reddit guys really seem to like HAProxy. Here's a brief tutorial showing HAProxy being used with Amazon's EC2. You can find much more information at the HAProxy web site.

I use HAProxy on a number of production servers and love it. It is easy to configure and even has a simple web interface to check it's status and stats in real-time. A screencast that helped me setup my first instance of HAProxz can be found on the [Signal versus Noise blog][1] [1]: 37signals.com/svn/posts/1073-nuts-bolts-haproxy –  Wes Oldenbeuving Apr 30 '09 at 12:55
I forgot about the managability aspect. This sounds very nice. –  Mark Renouf Apr 30 '09 at 15:23

The question doesn't provide specific information about load, features needed etc, so as such any answer is at best a guess.

Pound is a good choice for smaller / midsized sites. It offers HTTPS support and easy setup.

HAproxy can scale to saturate 10G Ethernet pipes, and offers connection limiting, i.e. sending only the number of simultaneous requests to each backend server as you have Apache children / Ruby on Rails instances to handle.

nginx is great as a allround load balancer and static file server. It can perform HTTP compression, URL rewriting and static file serving while doing load balancing.

Apache is in the 2.2 series a pretty good load balancer as well. Can do much the same as nginx, but places a higher load on the server than nginx. Very worth looking into if you're already familiar with Apache, and very mature.

Perlbal offers easy connection limiting to backend hosts, multiplexing requests across persistent HTTP connections, and easy setup if you're already using Perl.

Varnish cache is a reverse HTTP proxy, with basic load balancing support. It's not a great load balancer, but in some situations its in-memory caching of most requested objects can remove a high percentage of the backend server hits, and it has great performance. ESI includes are potentially interesting.

I'm not 100% sure, but off the top of my head Perlbal and nginx offer some support for changing the config without re-starting the load balancer. For larger sites this is critical, and it's one of the things that good commercial load balancer appliances do well.

All of the above are HTTP level (layer 7) load balancers. TCP/IP level load balancers have the potential to reach higher throughput, but are limited in other ways. The HAProxy author has written a good, readable overview of load balancing methods and issues: http://1wt.eu/articles/2006_lb/

LVS is a widely used TCP/IP level load balancer. Most firewalls can also do basic load balancing on IP level, by hashing the incoming request out over a range of backend IP addresses -- at least OpenBSD's PF and Cisco ASA and Juniper Netscreens can do this.


haproxy works well as does LVS.

FWIW, wordpress.com uses nginx as their balancer/proxy.


We use LVS in production. It is managed by our operations team with a set of complex and evil scripts. A rather clever bespoke system announces health and performance data from our realservers to allow the load balancer to set weights accordingly.

LVS of course gives you a single point of failure - the load balancer (there are ways to set them up redundantly).

I thought this was too complicated to set up so I wrote Fluffy Linux Cluster which was based loosely on how Windows NLB works (I think... I'm not sure how that works though) and also inspired by CLUSTERIP.

We don't use it in production but Fluffy can load-balance a reasonable (5 at least) number of servers with no single point of failure and no central management node etc.

Hmm: LVS, evil scripts, rather clever bespoke systems. Your setup is exactly like ours! –  Tom Anderson May 11 '12 at 11:13

I've used Pound in the past. It's fast, simple and requires minimal attention.


I'm a massive fan on Zeus's ZXTM multi-layer LBs - click HERE


If you decide to go with LVS then I would also look into Keepalived if you are going to make your load balancing server layer highly available. I had been using Heartbeat/Pacemaker with LVS for several months and found it to be too complicated and sometimes unstable for a simple HA LB layer.

