GZip compression in Perlbal

Mark Smith smitty at gmail.com
Wed Mar 5 19:18:25 UTC 2008

> There was a couple of commits to Perlbal svn recently that led to confusion.
> The aim of introduced changes was to allow Gzip compression of concatenated
> static files.

I like the feature idea, I think that it's best if such things come
through the mailing list just to give people a heads up of what is
going on.  What with Perlbal being used in so many environments and
all.  I quick-reviewed the changes, nothing seems overly scary or like
it'd be a problem, but I've not actually dug into testing it...

Anyway, I definitely think this kind of feature is useful.  Of course,
personally I'd want to fix the CPU problem!  I imagine that for most
usage patterns of Perlbal serving static files, you could define some
rules for when to gzip and when not to.  For example, here's a config
file that might explain it better:

   # only allow these extensions, which notably lets you skip gzip on
jpg/png/formats that are already compressed
   GzipAllowExtensions js,css,html,php,gif,bmp

   # store these files in memory and refresh every 10 seconds, this
will drop CPU as we don't have to compress
   # the same files over and over on popular files
   GzipSaveToMemoryExtensions js,css,html
   GzipSaveToMemoryTimeout 10

The idea is then that these small files are just stored in memory and
we don't have to re-gzip them every time, plus we can skip the
compression of files that  we know are not going to benefit very much
from it.

This is just food for thought, this functionality is well suited to a
plugin.  Overall I think the feature as committed is a good one that
Perlbal has been lacking and I'm fine with it going into the trunk,
but I would encourage you to try to take advantage of the mailing list
for things like this going forward.  :)


Mark Smith / xb95
smitty at gmail.com

More information about the perlbal mailing list