FreeBSD Pound Load Balancer PDF Print E-mail
Written by Winfield   
Tuesday, 24 February 2009 16:16

At TMM our latest project is to upgrade the server infrastructure. As part of this upgrade we are going to incorporate Pound on two Freebsd 7.1 machines in front of our webservers.

Pound is essentially a reverse HTTP Proxy that works to balance the incoming load between 2 or more backend machines. The installation and setup is about as straightforward as it can be.

In order to try this out I setup 2 virtual machines on my WindowsXP laptop using VMWare. Both installs were the minimal FreeBSD 7.1. On the web server machine I used Jail to setup 2 virtual web servers (another article will cover that) with independent IP's. Then on the pound VM I did no more that install pound. Since this was a test I installed from the packages. The package actually did not install a config file so that had to be created. In /etc I created pound.cfg and it looked something like this:

            Address {wild side network card of pound machine}
            Port    80
                    Address {one of my Jail web servers}
                    Port    80
                    Address {the other Jail web server}
                    Port  80

Then it was a matter of starting pound with this file:
/usr/local/bin/pound -f /etc/pound.cfg

When I use a browser to hit the pound machine it would send the requests to one of the two backend servers. I actually put different index pages on these servers and kept hitting refresh on the browser to witness the "load balancing". Basically it would alternate between the two web servers fairly randomly but nonetheless interesting to watch.

One thing to consider if this is going to go into production is the fact that the web server logs on the backend machines will be useless as far as web statistics go. This is because the pound machine gets all the hits from outside and logs appropriately while the webservers just see hits coming from the pound machine. Pound does have an option to log 'apache combined' format. So if stats are to be rendered on the web server then the logs from pound probably need to be transferred to the web server machines for processing.

This only begins to touch on the applications of Pound so please visit their website to find out more.

To be continued....

Last Updated on Thursday, 03 September 2009 19:54