Reputation: 105
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" )
))
)
So, there would be 1 fastcgi backend with 2 processes. These processes accept load.
I don't understand the following:
Upvotes: 4
Views: 6811
Reputation:
Hope this sheds some light on the situation
A little context for the rest of this answer:
A 'main' process is a process that gets spawned. This is able to share all it's resources [like memory] with its children. But however does not handle php requests, think of this like a container for the actual request handlers
A 'child' process is what actually handles the php requests. This in turn also is a very big factor in how much load you put on a 'main' process.
The general strategy here should be to minimize the amount of 'main' processes and maximize the amount of 'child' processes while maintaining stability since child processes will have a shared opcache, memoryspace and system resources with thier siblings.
PHP_FCGI_CHILDREN
= The amount of child processes a 'main' process can spawn.PHP_FCGI_CHILDREN
PHP_FCGI_CHILDREN
and it defaults to 1, and if set to another value always adds 1 to the number you specify [so if you specify it as 1 it adds 1, so it will become 2]PHP_FCGI_CHILDREN=0
each 'main' process will only spawn 1 child processUpvotes: 3