You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Angela Focazio <an...@technogeeks.com> on 2000/08/20 19:55:25 UTC

Centralized Caching


    It seems very inefficient on memory to have each child process forms
its own cache, so I was interested in creating a centralized cache that
all of the child processes could dip into (actually forming a module
that allows for I/O & control of a centralized cache - expiring
information, delegating a maximum size to different structures, you get
the clue). Has anyone had luck with this? And if so, did having a single
cache slow down access speeds? I messed around a good bit, but haven't
found a way to get it to work.

    Thanks SO much! This has been slowing eating up my brain trying to
think about how to do it!

    Terry Moran


Re: Centralized Caching

Posted by "T.J. Mather" <tj...@thoughtstore.com>.
You might want to look into IPC::SharedCache or IPC::Shareable.  These
modules cache variables in shared memory.


Re: Centralized Caching

Posted by Perrin Harkins <pe...@primenet.com>.
Angela Focazio wrote:
> 
>     It seems very inefficient on memory to have each child process forms
> its own cache, so I was interested in creating a centralized cache that
> all of the child processes could dip into (actually forming a module
> that allows for I/O & control of a centralized cache - expiring
> information, delegating a maximum size to different structures, you get
> the clue). Has anyone had luck with this?

There are several modules that do things like this on CPAN.  If none of
those meets your needs, you might try building one on the shared memeory
hash structure provided by IPC::MM or use BerkeleyDB (not DB_File) which
also allows for shared memeory with multiple readers/writers.

- Perrin

Re: Centralized Caching

Posted by Dave Rolsky <au...@urth.org>.
On Sun, 20 Aug 2000, Angela Focazio wrote:

>     It seems very inefficient on memory to have each child process forms
> its own cache, so I was interested in creating a centralized cache that
> all of the child processes could dip into (actually forming a module
> that allows for I/O & control of a centralized cache - expiring
> information, delegating a maximum size to different structures, you get
> the clue). Has anyone had luck with this? And if so, did having a single
> cache slow down access speeds? I messed around a good bit, but haven't
> found a way to get it to work.

I did briefly try this out and found that large IPC caches tended to be
very slow.  I didn't experiment with another cache mechanism.

I do have a potentially interesting cache module as part of my Alzabo
project (a perl data modelling tool & RDBMS-OO mapper) that caches data
inside an individual process but uses IPC to control expiration of the
data between multiple processes.  Its called Alzabo::ObjectCacheIPC in the
modules.  Its got a fairly generic interface and could be used outisde
Alzabo.  Alzabo is at alzabo.sourceforge.net

-dave

/*==================
www.urth.org
We await the New Sun
==================*/