in reply to Re: Sharing data structures in mod_perl
in thread Sharing data structures in mod_perl

With the staleness check above, I was trying to NOT serialize the data, therefore storing a reference in a global shared among httpd processes. This wasn't working, obviously, and for good reason.

I agree that serializing is fast, except when you are trying to serialize too large a structure (we're talking foolishly large, here. My bad. Basically, I was serializing/deserializing a structure that was MUCH larger than it needed to be. I wouldn't think to do this with a DBI query, don't know why I was thinking it'd be OK when I did it with Storable.) I'm probably going to move toward splitting my structure into MUCH smaller chunks and still serializing it, or back to straight DBI. I haven't decided., this is going to depend on the results of some benchmarking I need to whip up, and the opportunity cost of switching my code.

-Any sufficiently advanced technology is
indistinguishable from doubletalk.

  • Comment on Re: Re: Sharing data structures in mod_perl

Replies are listed 'Best First'.
Re: Re: Re: Sharing data structures in mod_perl
by perrin (Chancellor) on Mar 28, 2002 at 17:20 UTC
    With the staleness check above, I was trying to NOT serialize the data, therefore storing a reference in a global shared among httpd processes.

    Yeah, you can't do that. Globals are not shared between processes. That's not a mod_perl thing; it's just how processes work.

    One more tip: others have seen great results from Cache::Mmap. You may want to look at that.

Re: Re: Re: Sharing data structures in mod_perl
by mla (Beadle) on Mar 30, 2002 at 05:43 UTC
    Did you try benchmarking the serialization in memory without any disk I/O?

    In my experience Storable is amazingly fast and it was the disk that quickly became the bottleneck.
    But then I was only using ~ 5k structures.