|
Home > Archive > Apache Server configuration support > February 2006 > Which is better, apache environment variables, shared memory or filesystem object for
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Which is better, apache environment variables, shared memory or filesystem object for
|
|
|
| I have inherited a heavily used web system and am currently reviewing how
the cgi's are initialised.
At present the c++ cgi's are built on a base class which reads a text file
to set the value of static data members. The data members are then used
throughout the lifetime of the cgi, which may be anywhere from 1 second to
3 minutes depending on the http request parameters.
This initialisation process is repeated each time a cgi starts which can be
as many as 512 processes every 3 seconds during really busy times. The
file is around 2K in size, consisting of around 125 lines.
I am now thinking of changing this process to one of the following
mechanisms.
1) Load the file contents in to a series of apache environment variables
such that a array can be constructed for processing by the base class in
place of the text file when the cgi is started.
2) Load the file in to a shared memory segment via a loader tool such that
the memory is constructed as a c++ class which each cgi can map in the base
class ctor.
3) Load the file in to a shared memory segment as a array of strings so that
the base class ctor can process them as it currently does the existing
file.
The obvious drawback is that in order to change the dynamic system
configuration, method 1 requires that the apache server must be restarted,
whilst method 2 and 3 require that the memory loader tool be rerun.
So my questions are
1) Would there be sufficient performance gains to justify the development
effort?
2) Which method would be better?
TIA,
Pep.
|
|
|
|
|