Pound

Pound

Pound is a wonderful tool. It does just what you want, and does it good. Well, most of the time actually. Let me present it.

Pound is made by a Swiss company named Apsis GmbH (http://www.apsis.ch/), and its purpose is to achieve 3 goals :
– reverse proxy
– load balancing
– HTTPS front-end

You don’t need to use all 3 features, but you might need it anyway. Don’t assume it can do other things : No caching, no webserver, no acceleration. Just what it’s meant for.

Why to use pound with an example
Now let’s say you have several (n) webservers, running at the same time, and maybe for several websites. Maybe you have the luck to have a public IP address for each of your webservers or websites, and assigned one website to one webserver. Then, if one of the webserver goes down or fails, then you have one website down.

You might have thought to spread all the websites on a part or even all of the wervers, and load-balance them with dns Round-robin. But now, if one server fails, what happens? Your website will seem to be down each 1/n call, because round robin is just simple load balancing, it doesn’t know if a server is alive or not. So, maybe you could use heartbeat to take one server IP when it goes down, and then overload another webserver. And the more server you have, the more it becomes tricky.

Or you could use pound. Pound wil be the single entry point for all of your websites. It takes everything, and dispatch query amongst servers according to their header hostname. So, you can have one website per server, but it’s kind of stupid cause if one server goes down the website is still down. Let’s just spread all the websites on all the servers, and assign different priorities to specialize each server and partition the traffic, in order to avoid some website to slow done another website.

For example, you have 3 websites and 4 servers :
server1 : pound
server2 : web1 with priority 9, web2 with priority 1, web3 with priority 1
server3 : web1 with priority 1, web2 with priority 9, web3 with priority 1
server4 : web1 with priority 1, web2 with priority 1, web3 with priority 9

In this example, 9 of 11 pages for web1 will be served by server1, and 2 of 11 pages by server 2 ans server 3. If server1 goes down, the traffic will be automatically and fairly spread amongst server2 and server3, so that the overload shouldn’t slow down too much another server/website and end by getting all of them down. Same with the other websites of course.

Installation
If you’re on Debian or Ubuntu, just aptitude it :

sudo aptitude install pound

If not, install it your distro way (as long as you have version 2.x and above, it should be ok.), or download it from the official website, and in this case I can just invite you the read the README file, it’s really well explained.

I will now assume that you run Pound on Ubuntu or Debian.
Once installed via aptitude, edit the file /etc/default/pound and change “startup=0” in “startup=1”, or pound will refuse to start.

Setup and configuration options
The configuration takes place in one single file : /etc/pound/pound.cfg The example config is simple but gathers the main options.

## Minimal sample pound.cfg
##
## see pound(8) for details


######################################################################
## global options:

User            "www-data"
Group           "www-data"
#RootJail       "/chroot/pound"

## Logging: (goes to syslog by default)
##      0       no logging
##      1       normal
##      2       extended
##      3       Apache-style (common log format)
LogLevel        1

## check backend every X secs:
Alive           30

## use hardware-accelleration card supported by openssl(1):
#SSLEngine      ""

# poundctl control socket
Control "/var/run/pound/poundctl.socket"


######################################################################
## listen, redirect and ... to:

## redirect all requests on port 8080 ("ListenHTTP") to the local webserver (see "Service" below):
ListenHTTP
        Address 127.0.0.1
        Port    8080

        ## allow PUT and DELETE also (by default only GET, POST and HEAD)?:
        xHTTP           0

        Service
                BackEnd
                        Address 127.0.0.1
                        Port    80
                End
        End
End
Comments are closed.
db9194b37bfab95a5cc958f471d454e7IIIII