nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone attempted to serialize->compress session data into an Apache::Session store, and uncompress->deserialize it out?

I know that many of the stores transparently handle the serialization -- I'm just noticing that my session data is growing larger and larger, and could likely benefit from some sort of elementary compression.

Or, it could be a giant mess -- and put too much a strain on a server that could just get another drive or more memory.

But someone out there might have thought of this before me , and can chime in.

Replies are listed 'Best First'.
Re: Apache::Session and Compression
by PodMaster (Abbot) on Mar 31, 2005 at 07:50 UTC
    I'm just noticing that my session data is growing larger and larger, and could likely benefit from some sort of elementary compression.
    Maybe you have too much session data (what's large)? Is it accessed often? What's the average lifespan? It shouldn't take more than a line of code using some Compress:: module from cpan, so you should go ahead and make the change and see how that affects performance.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Apache::Session and Compression
by nmerriweather (Friar) on Mar 31, 2005 at 14:45 UTC
    session data is currently 500bytes to 50k, depending on what i'm preloading for the user

    using bzip or gzip compression on session File, the 50k becomes 900bytes

    i'll have to bench what perl can do in time and filesize. i guess my options would be either compress the files before/after apache reads/writes them, or if i'm using a bdb or memory store, serialize the data then compress it before putting it in the store.