Tibor Simko schrieb:
> On Mon, 20 Jul 2009, Henning Weiler wrote:
>> When running Apache in -X (one instance only in debug mode),
>> everything works fast and fine.
>
> Okay. So the next step is to run one instance without debug mode, via
> setting MaxClients and friends; see below.
>
>> I could not figure out which mpm it uses (no loadmodule on the mpms to
>> be found anywhere), but I guess it is prefork.
>
> With prefork MPM you should be all fine. You can see which MPM are you
> using by the -V switch, e.g. on Gentoo:
>
> $ /usr/sbin/apache2 -V | grep -i mpm
> Server MPM: Prefork
> -D APACHE_MPM_DIR="server/mpm/prefork"
>
> e.g. on SLC4:
>
> $ /usr/sbin/httpd -V | grep -i mpm
> -D APACHE_MPM_DIR="server/mpm/prefork"
>
> You can tweak MPM settings in your Apache config file somewhere, look
> for places like:
>
> <IfModule mpm_prefork_module>
> StartServers 1
> MinSpareServers 3
> MaxSpareServers 5
> MaxClients 5
> MaxRequestsPerChild 1000
> </IfModule>
>
> E.g. does your Apache work well if you define MaxClients to be 1?
>
> If segfaults occur only from time to time, then you can debug the
> problem also via dumping core and using gdb on it, see:
>
> <http://httpd.apache.org/dev/debugging.html#crashes>
>
> But strace should have given you some indications too; but maybe you
> have used strace only with the -X mode, where things work fine? If so,
> you may try to use strace under normal conditions too.
>
> Best regards
OK, I think it was really the mpm prefork module which caused the problem.
Using apache2 -X (one apache instance in debug mode) works flawlessly. Using
the following settings
for the prefork module in /etc/apache2/apache2.conf also work without
presenting a seg fault:
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 3
MaxSpareServers 5
MaxClients 1
MaxRequestsPerChild 1000
</IfModule>
Important seems to be the MaxClients setting. If I set it to anything greater
than 1, the segfaults
keep comeing back.
Log snippet:
starting with maxClients > 1
------ 8< ------
[Tue Jul 21 10:11:02 2009] [notice] child pid 9003 exit signal Segmentation
fault (11)
[Tue Jul 21 10:11:53 2009] [notice] caught SIGTERM, shutting down
------ 8< ------
starting with maxClients = 1
------ 8< ------
[Tue Jul 21 10:12:36 2009] [notice] mod_python: Creating 1 session mutexes
based on 1 max processes
and 0 max threads.
[Tue Jul 21 10:12:36 2009] [notice] mod_python: using mutex_directory /tmp
[Tue Jul 21 10:12:36 2009] [notice] Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4.2
with Suhosin-Patch
mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g configured --
resuming normal operations
[Tue Jul 21 10:12:37 2009] [error] server reached MaxClients setting, consider
raising the
MaxClients setting
------ 8< ------
everything works.
using strace on one of the forked apache children seems rather difficult?!
strace shows me, that a
child is spawned but does not follow this call. Any ideas on how I could to
this?
Cheers,
Henning
--
Henning Weiler
CERN - Open Access Section
Postbox C24300
Tel: +41-22-767-7836
eMail: [email protected]