Forums » Development »
[Solved] Meaning of PHP_FCGI_CHILDREN and max-procs in Lighttpd and Fastcgi configuration
Added by Anonymous almost 9 years ago
There are 4 fields in fastcgi configuration, max-procs, max-load-per-proc, PHP_FCGI_CHILDREN,PHP_FCGI_MAX_REQUESTS :
fastcgi.server = ( ".php" =>
(( "socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php",
"max-procs" => "2",
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "3",
"PHP_FCGI_MAX_REQUESTS" => "10000" )
))
)
1. Since there is only 1 entry in fastcgi.server, there will be 1 Fastcgi backend.
2. Since PHP_FCGI_CHILDREN =3 and max-procs=2, the number of "/usr/local/bin/php" processes will be 2*(3+1)=7.
3. Since max-procs=2, in the server status, there would be status of fastcgi.backend.0.0 and fastcgi.backend.0.1
So, there would be 1 fastcgi backend with 2 processes. These processes accept load.
I don't understand the following:
1. What is the significance of PHP_FCGI_CHILDREN?
2. Is a request handled by a PHP_FCGI_CHILDREN or by a proc?
3. Which parameter decides the max-load of 1 proc? And what is its default value?
4. Does the max-load of a proc have any relation with PHP_FCGI_MAX_REQUESTS?
5. What would happen if PHP_FCGI_CHILDREN=0? It was mentioned that max-proc = number of watchers and max-proc*PHP_FCGI_CHILDREN= number of workers. What does that mean?
6. When is a proc said to be overloaded?
Replies (1)
RE: Meaning of PHP_FCGI_CHILDREN and max-procs in Lighttpd and Fastcgi configuration - Added by gstrauss almost 9 years ago
Have you looked in the wiki documentation?
https://redmine.lighttpd.net/projects/1/wiki/Docs_ModFastCGI
Have you looked in the FAQ?
https://redmine.lighttpd.net/projects/1/wiki/FrequentlyAskedQuestions#How-many-php-CGI-processes-will-lighttpd-spawn
Have you tried using a search engine before making multiple posts to this forum?
https://www.google.com/#q=PHP_FCGI_CHILDREN+PHP_FCGI_MAX_REQUESTS
http://serverfault.com/questions/199953/lighttpd-php-fcgi-children-correct-value