Snippet

Simple load balancing using Pound




The Pound program is a reverse proxy, load balancer and HTTPS front-end for Web server(s). Pound was developed to enable distributing the load among several Web-servers and to allow for a convenient SSL wrapper for those Web servers that do not offer it natively.
1. Install the pound package
apt-get install pound
2. Configure the load balancing. Replace everything below and including ListenHTTP with something like this: (pico /etc/pound/pound.cfg)


ListenHTTP
  Address 0.0.0.0
  Port 80
  xHTTP 0
 
  Service
    HeadRequire "Host: .*www.google.com.*"
 
    BackEnd
      Address 209.85.227.103
      Port 80
    End
    BackEnd
      Address 209.85.227.104
      Port 80
    End
    BackEnd
      Address 209.85.227.105
      Port 80
    End
    BackEnd
      Address 209.85.227.106
      Port 80
    End
  End
End
In this example we'll be listening for www.google.com and forward requests to 4 of Google's web servers/clusters. You can of course replace the domain with one of your own and point it to any servers. The servers can be on different networks, using different platforms and you can even forward different paths to different servers. Ex. www.google.com/apps could be forwarded to 1.2.3.4 while www.google.com is forwarded to 2.3.4.5. Click here for more details about Pound

Leave a Reply