Apache 2.2, worker mpm, mod_fcgid and PHP: Can't apply process slot

Posted by mopoke on Server Fault See other posts from Server Fault or by mopoke
Published on 2011-09-28T04:01:00Z Indexed on 2013/10/20 3:57 UTC
Read the original article Hit count: 559

Filed under:
|
|
|
|

We're having an issue on an apache server where every 15 to 20 minutes it stops serving PHP requests entirely. On occasions it will return a 503 error, other times it will recover enough to serve the page but only after a delay of a minute or more. Static content is still served during that time.

In the log file, there's errors reported along the lines of:

[Wed Sep 28 10:45:39 2011] [warn] mod_fcgid: can't apply process slot for /xxx/ajaxfolder/ajax_features.php
[Wed Sep 28 10:45:41 2011] [warn] mod_fcgid: can't apply process slot for /xxx/statics/poll/index.php
[Wed Sep 28 10:45:45 2011] [warn] mod_fcgid: can't apply process slot for /xxx/index.php
[Wed Sep 28 10:45:45 2011] [warn] mod_fcgid: can't apply process slot for /xxx/index.php

There is RAM free and, indeed, it seems that more php processes get spawned.

/server-status shows lots of threads in the "W" state as well as some FastCGI processes in "Exiting(communication error)" state.

I rebuilt mod_fcgid from source as the packaged version was quite old. It's using current stable version (2.3.6) of mod_fcgid.

FCGI config:

FcgidBusyScanInterval      30
FcgidBusyTimeout           60

FcgidIdleScanInterval      30
FcgidIdleTimeout           45

FcgidIOTimeout             60
FcgidConnectTimeout        20

FcgidMaxProcesses          100
FcgidMaxRequestsPerProcess 500

FcgidOutputBufferSize      1048576

System info:

Linux xxx.com 2.6.28-11-server #42-Ubuntu SMP Fri Apr 17 02:45:36 UTC 2009 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"

Apache info:

Server version: Apache/2.2.11 (Ubuntu)
Server built:   Aug 16 2010 17:45:55
Server's Module Magic Number: 20051115:21
Server loaded:  APR 1.2.12, APR-Util 1.2.12
Compiled using: APR 1.2.12, APR-Util 1.2.12
Architecture:   64-bit
Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=""
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"

Apache modules loaded:

alias.load
auth_basic.load
authn_file.load
authz_default.load
authz_groupfile.load
authz_host.load
authz_user.load
autoindex.load
cgi.load
deflate.load
dir.load
env.load
expires.load
fcgid.load
headers.load
include.load
mime.load
negotiation.load
rewrite.load
setenvif.load
ssl.load
status.load
suexec.load

PHP info:

PHP 5.2.6-3ubuntu4.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Sep 16 2010 19:51:25)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

© Server Fault or respective owner

Related posts about linux

Related posts about php