= Apache Tuning =
[[PageOutline]]
The goal of this page is to give some details about experiments for Apache tuning in Nebulous use context. When many requests are sent to Nebulous, the Apache server displays messages in its log looking like:
{{{
[Thu Mar 10 09:11:09 2011] [info] server seems busy, (you may need to increase StartServers,
or Min/MaxSpareServers), spawning 8 children, there are 0 idle,
and 128 total children
[Thu Mar 10 09:11:10 2011] [notice] child pid 6790 exit signal Segmentation fault (11)
[Thu Mar 10 09:11:10 2011] [notice] child pid 6791 exit signal Segmentation fault (11)
[Thu Mar 10 09:11:10 2011] [notice] child pid 6792 exit signal Segmentation fault (11)
[Thu Mar 10 09:11:10 2011] [notice] child pid 6793 exit signal Segmentation fault (11)
}}}
Such messages are seen when the server is overwhelmed by requests. The goal of the experiments is to determine the Apache configuration where such messages could be avoided.
== Introduction ==
=== Apache Configuration ===
For convenience, the Apache log level has been set to debug (on ippdb00, it is set to warn).
The original mpm_prefork_module configuration for Apache is the following:
{{{
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 10000
}}}
Such a configuration will be written: '''[5, 5, 10, 150]''' (to avoid any confusion, if the MinSpareServers value was 6, the configuration would be denoted [5, 6, 10, 150]).
Constraints on the configuration can be seen in the [http://httpd.apache.org/docs/2.0/mod/prefork.html prefork] module configuration documentation.
=== Experiment ===
I wrote a small utility script that starts ''nbProcesses'' processes. Each process attempts to create ''nbFiles'' files in Nebulous using ''neb-touch''. To ensure that files do not previously exist in Nebulous, each instance of the utility script is called with an index argument (let's call it ''experimentNb''). Each experiment is run this way:
{{{
python startNebFilesCreation.py
}}}
and creates ''*'' files in Nebulous named:
{{{
neb://////
}}}
The path length is adjusted through the '''' which is basically a sequence of "1234567890/" strings to have a total length of about 200 bytes which is the average size of a Nebulous instance entry.
Since an experiment depends on the Apache configuration, an experiment is fully described by (, , , ) where is the 5-uple shown in [wiki:ApacheTuning#ApacheConfiguration Apache Configuration paragraph].
=== Operating Conditions ===
The experiments are performed on ippc01 where a local Nebulous database has been installed. To avoid any conflict with existing tools, a local ''neb-touch'' was used (URL: https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/tags/ipp-20110218/Nebulous/bin/neb-touch; Revision: 30846).
== Experiments ==
The template for "server seems busy" messages is:
{{{
[info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers),
spawning '''' children,
there are '''' idle, and '''' total children
}}}
The values of (, , ) are provided when the message is observed.
=== Experiment 01 ===
Original configuration: (01, 100, 10, [5, 5, 10, 150, 10000]).
Apache was just restarted (/etc/init.d/apache2 restart)
10:52 No "server seems busy" message (and therefore no "Segmentation fault")
=== Experiment 02 ===
No parameter change (but the experiment ID): (02, 100, 10, [5, 5, 10, 150, 10000]).
Apache was not restarted.
10:53 4 "server seems busy messages" (values were (8, 0, 17),(16,0, 25), (32, 0, 41), (32, 0, 73)). No "Segmentation fault" observed.
=== Experiment 03 ===
No parameter change (but the experiment ID): (03, 100, 10, [5, 5, 10, 150, 10000]).
Apache was not restarted.
10:55 No "server seems busy" message (and therefore no "Segmentation fault")
=== Experiment 04 ===
No parameter change (but the experiment ID): (04, 100, 10, [5, 5, 10, 150, 10000]).
Apache was not restarted.
10:57 No "server seems busy" message (and therefore no "Segmentation fault")
=== Experiment 05 ===
No parameter change (but the experiment ID): (04, 100, 10, [5, 5, 10, 150, 10000]).
Apache was not restarted.
10:58 4 "server seems busy messages" (values: (8, 0, 20), (16,0,28), (32,0,44), (32,0,76)). No "Segmentation fault" observed
''Conclusion 1'' It seems that when the delay between two experiments is short, the "server is busy" messages can be observed.
=== Experiments 06 and 07 ===
=== Experiment 01 ===