On 26/10/11 14:56, Max Barry wrote:
> I'm trying to solve a long-running problem whereby my Apache mod_perl
> processes get stuck in a "FUTEX_WAIT" state instead of exiting.
>
> I believe this is the same issue as reported here:
> http://www.gossamer-threads.com/lists/modperl/modperl/99879
>
> The problem occurs fairly frequently following a burst of traffic, when
> Apache spawns new processes, then attempts to cull them afterward. It
> also occurred, before I disabled this, when Apache tried to cull a
> process upon reaching MaxRequestsPerChild.
Further to this, I've found that the problem occurs even on a fresh
Apache/mod_perl install; i.e. after completely removing Apache &
mod_perl, including /etc/apache2/, and doing only this:
1. sudo apt-get install apache2-mpm-worker libapache2-mod-perl2
apache2-doc
2. Edit the 'default' site thusly:
--- /etc/apache2/sites-available/default.original 2011-10-27
08:44:11.383803928 +1100
+++ /etc/apache2/sites-available/default 2011-10-27 08:44:51.795391116
+1100
@@ -19,6 +19,9 @@
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
+
+ SetHandler perl-script
+ PerlResponseHandler ModPerl::RegistryBB
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
3. Add a low 'MaxRequestsPerChild' directive (not strictly necessary,
but makes the problem much more visible):
--- /etc/apache2/httpd.conf.original 2011-10-27 08:52:48.898361041 +1100
+++ /etc/apache2/httpd.conf 2011-10-27 08:58:52.384091605 +1100
@@ -0,0 +1 @@
+MaxRequestsPerChild 10
4. sudo /etc/init.d/apache2 restart
5. ab -n 450 -c 175 http://localhost/cgi-bin/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
apr_poll: The timeout specified has expired (70007)
Total of 426 requests completed
(The number "426" above varies: sometimes it's as low as 400, sometimes
all requests complete. Usually, though, it's around 430.)
I've also established that:
* The problem occurs regardless of whether ModPerl::Registry,
ModPerl::RegistryBB, or ModPerl::PerlRun is used.
* The problem occurs even when all Apache modules are disabled except
for alias, authz_host, and mod_perl.
* The problem occurs even when no script is being run: i.e. Apache is
asked for "/cgi-bin/nonexistentscript.cgi", or just "/cgi-bin/".
This is pretty perplexing.
Max.