[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: memory resident config hash
From:       "Octavian Rasnita" <orasnita () fcc ! ro>
Date:       2005-08-28 7:01:53
Message-ID: 002f01c5ab9e$6bc85240$c2a2b451 () ted
[Download RAW message or body]

Ok, thank you. That example from perlref is what I was searching for, but it
seems that  it can't do what I want. (I didn't know that programs that use
'require' don't share the memory).

I will try to use Config::Simple.

I need to store a few hashrefs in the memory.

Thank you very much.

Teddy

From: "Michael Peters" <mpeters@plusthree.com>
> If these are just .ini files, then why don't you use something like
> Config::Simple to create a object from which to read the data. You could
> then create a wrapper class that would give access to this object as a
> singleton. Load the class on server startup and initialize the object
> there too. As long as you don't change the data it should be stay shared
>  by all of your apache children.
>

> Once you do a 'require' in a process the data is no longer shared
> between processes. Another request that needs the same configuration
> data that is handled by a different apache process will need to do the
> same 'require' thus increasing it's unshared memory, etc.
>
> Sometimes this is necessary, but it should be avoided if possible. How
> many of these language specific configs do you have? Do you know which
> ones are more likely to be used? If you do then preload as many as
> possible ahead of time.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic