/ Zope / Apsis / Pound Mailing List / Archive / 2008 / 2008-04 / Re: [Pound Mailing List] regex optimizing?

[ << ] [ >> ]

[ 'Request URI is too long.' MaxRequest ignored? ... ] [ Sessions in pound / Piotr Jakubowski ... ]

Re: [Pound Mailing List] regex optimizing?
Dave Steinberg <dave(at)redterror.net>
2008-04-16 01:43:47 [ SNIP ]
David L Kensiski wrote:
> Are regular expression lookups optimized in pound?  I.e are they put 
> into a hash table of any sort, or are they scanned sequentially each 
> time a new request comes in?  I have a 4600 line config file with around 
> 270 different "HeadRequire "Host:.*xyz.foo.com" matches and was 
> wondering if I'd see a performance difference between the first and last 
> entries.

Pound works on a first-match policy, so there would be some benefit to 
putting your highest traffic sites towards the top.  I don't think a 
hash table would work here, since there's no way to specify a way to key 
into that hash table given a particular header.  I like where you're 
going with the idea, I just don't think its supported.

Personally I haven't tried it, but I believe there's a benefit if pcre 
is installed when building pound, as well as google's perftools.

Just looking over the archives a bit, I'm thinking I should really give 
this a try, since people claim some wild performance gains!

Regards,
-- 
Dave Steinberg
http://www.geekisp.com/
http://www.steinbergcomputing.com/

Re: [Pound Mailing List] regex optimizing?
Bob Apthorpe <apthorpe(at)cynistar.net>
2008-04-16 01:26:51 [ SNIP ]
Hi,

David L Kensiski wrote:
> Are regular expression lookups optimized in pound?  I.e are they put 
> into a hash table of any sort, or are they scanned sequentially each 
> time a new request comes in?  I have a 4600 line config file with around 
> 270 different "HeadRequire "Host:.*xyz.foo.com" matches and was 
> wondering if I'd see a performance difference between the first and last 
> entries.

It might help to use the perl modules Regexp::Optimizer 
(http://search.cpan.org/~dankogai/Regexp-Optimizer-0.15/lib/Regexp/Optimizer.pm)

or Regexp::Assemble 
(http://search.cpan.org/~dland/Regexp-Assemble-0.32/Assemble.pm) to 
pre-process your list of hosts.

It's probably much easier to update a list than update a regex, 
especially one that's been machine-optimized.

-- Bob

Re: [Pound Mailing List] Sessions in pound
Piotr Jakubowski <Piotr.Jakubowski(at)bossa.pl>
2008-04-25 08:55:43 [ SNIP ]
Hi again,

Does anyone expierience the same problem? Or maybe no one uses Pond with 
cookie session tracking?

> (...) Parameter TTL>0 
> actually means in current version of pound an absolute time since the 
> first request (or response) with specified cookie to keep tracking of 
> session. (...)

> There is one more problem in get_backend() function (...)

Thanks for fixing it in 2.4.2.

Best regards.
Piotr

MailBoxer