POUND – Reverse proxy and load-balancer

Scaling up. For most people a nightmare area. What? How? Where? It usually comes down to how much money are you willing to spend and what is it that you actually need. Here is free as in free beer solution for all you geekz out there who need a simple load balancer and reverse proxy… oh and to allow for a convenient SSL wrapper for those Web servers that do not offer it natively. Guess you could go for nginx if you want – after using it for over a year it’s too bloated for what was needed. Pound came up as a far better solution.


So, let’s say you have a small server farm that consists of one FreeBSD machine that acts as a firewall/router and a several GNU/Linux machines in the backend which act as web servers distributing some content. We’re not going to go as deep as to research what is going on on those machines. All we want here is that our users come through the firewall and get served.

Let’s install pound first:

cd /usr/ports/www/pound && make install clean

Once installation is done open Pound’s configuration file (usually does not exist so just fire up your fav editor and create /usr/local/etc/pound.cfg). For very simple load balancer use the following configuration file:

Control “/var/run/pound”
ListenHTTP
Address 0.0.0.0
Port 80
xHTTP 0
LogLevel 2
End

Service
HeadRequire “Host:.*mysite.com.*”
BackEnd
Address 10.0.0.2
Port 80
End
End

And that’s it. Start Pound by issuing: /usr/local/etc/rc.d/pound start and see how your content gets served. There is a variety of things you can do with Pound. My suggestion is to check: http://www.apsis.ch/pound/ for details – their documentation is pretty short but very clear.

Tags: , , ,

Leave a Comment