Boysenberry Payne wrote:

> Is Apache::SharedMem working with mod_perl2 the "same" way it did with
> mod_perl1?

Don't know, haven't used it. It hasn't been updated since 2001, so either it's
perfect and hasn't needed any changes or it's not being maintained.

> Is Apache::SharedMem the "preferred" way to handle sharing memory
> between apache children?

It's definitely not "preferred", but I'm not sure what is. It depends on what
you're doing with the data and how often it changes. If it's static you can just
load the data at startup in a Perl module. If it changes a lot you can use BDB.
If it's something that needs to be shared by multiple machines then use
something external like MySQL. If it's just some cached data then use something
like memcached or Cache::FastMmap.

> Are modules loaded using "use ModuleName;" in an apache startup.pl file
> loaded into shared memory
> or copied to each child separately?

There's nothing special about "use". "require" would work just as well. The
thing to remember is that you need to load the Perl modules into the Apache
process's memory before it forks. Anything loaded before the fork will be shared
(as long as it doesn't change) with Copy-On-Write.

-- 
Michael Peters
Developer
Plus Three, LP

Reply via email to