httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sorin Manolache <sor...@gmail.com>
Subject Re: Sharing information across Apache child processes
Date Mon, 29 Sep 2014 14:14:56 GMT
On 2014-09-29 13:39, Rajalakshmi Iyer wrote:
> Hello,
>
> I have a requirement whereby my application's configuration information
> (comprising a few complex data structures) needs to be shared across the
> various Apache child processes.
>
> Currently, the configuration is being individually loaded by each child
> process, which makes it hard for configuration changes to propagate.
>
> What is the best way / place to have a common configuration for the
> application?
>
> Please advise.

I suppose you want to update the configuration without running "apache2 
-k graceful" (or "apache2ctl graceful").

In this case you could use a segment of memory that is shared across the 
apache children. You'll have to create the shared segment memory before 
the parent forks its children (for example in post_config). The shared 
memory is then inherited by the forked children.

You'll need a method to update the contents of the shared memory segment 
and a multiple-readers-single-writer inter-process exclusion mechanism 
in order to safely read and write from the shared segment.

Sorin


Mime
View raw message