/ Zope / Apsis / Pound Mailing List / Archive / 2005 / 2005-11 / Testing Pound version 2

[ << ] [ >> ]

[ Pound 2 cfg / "MW Mike Weiner (5028)" ... ] [ SSL Vhosts in Pound 2 / "MW Mike Weiner ... ]

Testing Pound version 2
"John Snowdon" <J.P.Snowdon(at)newcastle.ac.uk>
2005-11-23 13:06:04 [ FULL ]
I've been wanting to try out the later versions of Pound for some time
now, as our current version used to serve our live systems (approx 50
Zope systems spread across 9 dual cpu nodes) is still version 1.8
(pound.c,v 1.8 2004/11/04 13:37:07 - working without problem for us).

Luckily in the past few weeks we've begun to migrate equipment to a
second site, so it is the perfect opportunity to experiment with new
versions and different configurations before pressing the big, red, 'go
live' button ;-)

The first thing I like is the new configuration syntax, this is my first
config in the Pound 2 syntax (1x http host and 2x different https hosts
using the same certificate just for testing):

User            "loadbal"
Group           "loadbal"
Daemon          1
LogLevel        3
Alive           30

ListenHTTP
  Address         1.1.1.1
  Port            80
  HeadRemove      "HTTP_X_FORWARDED_FOR"
  Service
    HeadRequire     "Host:.*http-server.*"
      BackEnd
        Address         192.168.1.20
        Port            8000
    End
  End
End

ListenHTTPS
  Address         1.1.1.1
  Port            443
  Cert            "/usr/local/etc/certs/2005-2006/pound_certchain.pem"
  HeadRemove      "HTTP_X_FORWARDED_FOR"
  Service
    HeadRequire     "Host:.*https-service-1.*"
    BackEnd
      Address         192.168.1.20
      Port            8000
    End
  End
  Service
    HeadRequire     "Host:.*https-service-2.*"
    BackEnd
      Address         192.168.1.20
      Port            8001
    End
  End
End

... In my opinion this is much easier to scan - with each child service
belonging to a particular ListenHTTP/S parent. Well done! BTW, This
config seems to work fine :-)

One question I have at the moment is with multiple URL matches for a
single service, ie 3 or 4 paths for a given site are for static files
and are passed over to an apache server, whereas anything not matching
the HeadRequire patterns for a given Service should be load balanced to
multiple Zope servers.

Would this syntax work?

ListenHTTPS
  Address         1.1.1.1
  Port            443
  Cert            "/usr/local/etc/certs/2005-2006/pound_certchain.pem"
  HeadRemove      "HTTP_X_FORWARDED_FOR"
  Service
    URL		  "/images/*"
    URL		  "/documents/*"
    URL		  "/pdf/*"
    HeadRequire     "Host:.*zopeserver.*"
    BackEnd
      Address         192.168.1.20
      Port            80
    End
  End
  Service
    HeadRequire     "Host:.*zopeserver.*"
    BackEnd
      Address         192.168.1.30
      Port            10000
	Priority	    5
    End
    BackEnd
      Address         192.168.1.40
      Port            10000
	Priority	    5
    End
End

What I *think* this setup does is:
1. Define one SSL listener on 1.1.1.1
2. Setup a service looking for the hostname 'zopeserver' in the header
and any one of 3 URL patterns.
3. Setup a service looking for the hostname 'zopeserver', balancing
requests between 2 hosts.

Am I heading in the right direction with this? I've got rather a large
amount of services and URLgroups to transfer from our old Pound 1.x
config!

Incidentally, my old start/stop scripts seem to still work ok with
2.0... here they are if anyone wants them:
--------- snip here -----------
#!/bin/bash
# Start pound and redirect output to log files
/usr/local/sbin/pound >>/var/log/pound.log
2>>/var/log/pound.error.log &
--------- snip here -----------
#!/bin/bash
# Stop running pound processes
ps aux | grep pound | grep -v grep | awk '{print $2}' >/tmp/PIDlist
NUMBER=`wc -l /tmp/PIDlist`
if [ "$NUMBER" = "0" ]
then
        echo "No running process found"
else
        cat /tmp/PIDlist | while read PID
        do
                kill -9 $PID 2>/dev/null
                echo "Killed: $PID"
                rm /var/run/pound_pid*
                echo "Removed: /var/run/pound_pid.$PID"
        done
fi
--------- snip here -----------
#!/bin/bash
# poundlogzip - tidy log files up a little bit
DATE=`date +%d%m%y`
mv /var/log/pound.log /var/log/pound/pound.log.$DATE
mv /var/log/pound.error.log /var/log/pound/pound.error.log.$DATE
touch /var/log/pound.log
touch /var/log/pound.error.log
nice -n 19 gzip /var/log/pound/pound.log.$DATE
nice -n 19 gzip /var/log/pound/pound.error.log.$DATE
--------- snip here -----------

Regards

-John

 John Snowdon - IT Support Specialist
-==========================================-
 School of Medical Education Development 
 Faculty of Medical Sciences Computing
 University of Newcastle

 Phone : 0191 246 4549
 Email : j.p.snowdon(at)ncl.ac.uk

Re: [Pound Mailing List] Testing Pound version 2
Robert Segall <roseg(at)apsis.ch>
2005-11-23 14:31:10 [ FULL ]
On Wed, 2005-11-23 at 12:06 +0000, John Snowdon wrote:

...snip...
[...]

Many thanks for the report - this is helpful.
[...]

Not really. Multiple URL (or HeadRequire) are ANDed, not ORed. I think
what you really want is to replace your multiple URL definitions with

	URL	"/(images|documents|pdf)/.*"

to have them ORed.

One question: why do you define two back-ends at priority 5? Setting
them both at priority 1 does exactly the same thing.
[...]

OK.
[...]

Not really. Your setup looks for a request satisfying ALL of the
conditions (quite impossible).
[...]

The rest looks fine to me. BTW - glad you like the new syntax.[...]

RE: [Pound Mailing List] Testing Pound version 2
"John Snowdon" <J.P.Snowdon(at)newcastle.ac.uk>
2005-11-24 09:35:27 [ FULL ]
Thanks Robert....
[...][...][...][...][...][...][...][...][...]

Ah, that makes sense. Some of the services we will be moving to this new
version of pound were never running on our older version and have quite
a few URL's to catch; so this will simplify things somewhat.

The priority level is probably something subconscious, In my mind
setting all of the backends to a halfway weighting makes sense... but as
you rightly say, setting them all to 1 would do the same thing ;-) ..
consider it a bad habit I need to get rid of!
[...][...][...][...]

Gotcha, 'OR' them using the syntax as above.
[...][...]

Thanks again Robert. I'll be reporting back again once we have started
to move a large chunk of our Zope servers over - this will probably
start early next week (ZEO back ends are moving first). 

Again, first impressions are that Pound 2.0 is very slick and seems that
it will make my job a little easier (setting up and editing service
definitions) at the very least :-)

-John

MailBoxer