|
Disclaimer: I don't have any experience with FPM (Noooot going to compile PHP myself, tyvm); maybe mod_fcgid works better with it.
Anyway. "Standard" php-fastcgi can work in two modes.
In one, you spawn a single "php worker process", that's handling one request at a time.
That mode is fine with both mod_fastcgi, and mod_fcgid. You use the Apache modules "process management" features, and it's the mod_* that spawns and kils PHP subprocesses as it needs them. Quite like the MinSpareServers/MaxSpareServers/MaxClients directives work for Apache's own workers.
The other mode, which's obtained by setting PHP_FCGI_CHILDREN=<number> before starting php-fastcgi, starts a "master dispatcher" process, that spawns the number of children you've told it to, and "pipelines" multiple requests in parallel through itself to the subprocesses.
That mode is necessary to have APC work, because APC uses shared memory, and needs all PHP processes to be forked from the dispatcher to have access to it.
Using APC with the "simple PHP workers" would cause each of them to have its own cache. Quite pointless.
Now, mod_fcgid doesn't do pipelining.
If you'll use fcgid to spawn a php dispatcher tree, it'll see only the single process it started itself (the dispatcher), and it'll feed it one request at a time, and wait for it to complete before it sends the next one.
So, in result, you'll have all the php-children except one idling, and you'll be processing one php script at a time, period.
mod_fastcgi does pipelining, and thus lets you run your php dispatcher->children tree, making use of all the parallel workers, and letting them share the APC cache between them.
Seems like an easy decision to me.
_________________ rsk, providing useless advice on the Internet since 2005.
|