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