APC + php-cgi shared between child


I'm running nginx as frontend to apache + mod_php with good results.

Apache has keepalive off and is running with few threads and with the essential modules.

i made a few tests with php-cgi -d managed with supervisord and I like it.

It seams faster and under load uses less memory than apache, I just don't know if APC is shared between child processes.

Is APC shared between php-cgi child processes?



5 Replies

If you're using the

your webserver's master
\_ one php-fcgi parent process spawned by the master
  \_ many php-fcgi subprocesses spawneed by the parent
  \_ via PHP_FCGI_CHILDREN directive

setup, then yes.

Yes, supervisord is only running one parent process.

How many simultaneous requests can one parent process handle?

Is there any good article that explains the relation betwen requests/parent/child ?


I never looked for an article.

Generally, if your fastcgi supervisor pipelines requests, that is sends them to the handler as they come, instead of waiting for result of last one, you can hang just about as many PPHFCGICHILDREN off the php parent process as memory allows… tho you shouldn't need more than 20-30, I think. If supervisord is as stupid as Apache's mod_fcgid is, and assumes that one "handler" can process only one request at a time, and waits for response, it will limit you to one request at a time, tho, leaving all but one children idling.

That is because supervisord sees ONE handler, the php parent, which can't "tell" the supoervisord about its children.

Good fastcgi handlers do pipelining. Lighttpd's one do, and mod_fastcgi does too.

Thanks for you help :)

Justo looking for php-fpm -> https://launchpad.net/~brianmercer/+archive/php


Thanks for you help :)

Justo looking for php-fpm -> https://launchpad.net/~brianmercer/+archive/php

FPM was merged into PHP 5.3 in May, so it's in PHP mainline as of 5.3.3 RC1. It'll be a while before that makes it into distros, but still, good news.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct