V
V
Vladimir Merk2014-02-19 17:25:43
linux
Vladimir Merk, 2014-02-19 17:25:43

Server availability issues: how to fix "mod_fcgid: can't apply process slot for /srv/cgi/php-fcgi-starter" error?

Hello.
Just moved to a new server: 12 cores, ssd drive, 64Gb RAM.
The server has Apache worker, mod _fcgi, php-fpm, nginx.
On the server, a highly visited site and many local applications access the php script on the server.
Immediately there was a problem with the server responses. For some time, the response from the php script is 0.2-0.3 seconds, then it gradually increases to 2x, 3x, 10 seconds, then the server does not respond, then everything becomes normal. Here is a screenshot of multiple connections every 30 seconds:
content.screencast.com/users/Bred_s/folders/Jing/m...
These issues are accompanied by the error mod_fcgid: can't apply process slot for /srv/cgi/php-fcgi-starter
Settings such:
Apache:

<IfModule mpm_worker_module>
  ServerLimit 50
  MaxClients         2496
  MinSpareThreads     128
  MaxSpareThreads     350
  ThreadsPerChild     64
  MaxRequestsPerChild  200
</IfModule>

in VirtualHost
<IfModule mod_fcgid.c>
    FcgidBusyTimeout 3600
    MaxRequestsPerProcess 2000
    DefaultMaxClassProcessCount 120
    MaxRequestsPerProcess 200
    IdleTimeout 60
    IPCCommTimeout 60
    IPCConnectTimeout 30
    MaxRequestLen 10240000
  <Directory /srv/www/>
    Options -Indexes FollowSymLinks +ExecCGI
    AllowOverride All
    AddHandler fcgid-script .php
    FCGIWrapper /srv/cgi/php-fcgi-starter .php #<--------------------------------------
    Order allow,deny
    allow from all
  </Directory>
</IfModule>

The php-fcgi-starter file contains the following settings:
#!/bin/sh
#PHPRC="/usr/local/etc"
#export PHPRC
#PHP_FCGI_CHILDREN=16
#export PHP_FCGI_CHILDREN
#PHP_FCGI_MAX_REQUESTS=18000
#export PHP_FCGI_MAX_REQUESTS
exec /usr/lib/cgi-bin/php5

In Google, from the information on this error, I found recommendations to set the FcgidMaxProcesses or MaxProcesses setting (everywhere they write differently) to a large value. However, if I set this setting in VirtualHost to the IfModule mod_fcgid.c section, then Apache swears that there is a syntax error in the config.
Please tell me the best configuration option, even resource-intensive, this is not a problem for a large number of connections. Or just a way to get rid of this problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepan, 2014-02-19
@L3n1n

Apache as such, why do you need it at all?
nginx+php-fpm cope with hightload with a bang.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question