# APC + php-cgi shared between child

**URL:** <https://www.ruby-forum.com/t/apc-php-cgi-shared-between-child/190363>\
**Category:** NGINX\
**Created:** [June 18, 2010, 3:04pm UTC](https://www.ruby-forum.com/t/apc-php-cgi-shared-between-child/190363 "2010-06-18T15:04:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 18, 2010, 3:04pm UTC](https://www.ruby-forum.com/t/apc-php-cgi-shared-between-child/190363/1 "2010-06-18T15:04:14Z")

</div>

Hi,

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?

Thanks

Nuno.

Posted at Nginx Forum:

> **[APC + php-cgi shared between child](https://forum.nginx.org/read.php?2,99853,99853#msg-99853)**
>
> Hi, 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 fa

---

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 18, 2010, 6:19pm UTC](https://www.ruby-forum.com/t/apc-php-cgi-shared-between-child/190363/2 "2010-06-18T18:19:48Z")

</div>

Php-fpm is a bit easier to configure and offers a lot more than just  
php-cgi -b. I would definitely check it out.

---

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 18, 2010, 11:01pm UTC](https://www.ruby-forum.com/t/apc-php-cgi-shared-between-child/190363/3 "2010-06-18T23:01:24Z")

</div>

Thanks mike!

I’ll test this one → [OpenID transaction in progress](https://launchpad.net/~brianmercer/+archive/php)  
Look’s easy to setup 🙂

Posted at Nginx Forum:

> **[Re: APC + php-cgi shared between child](https://forum.nginx.org/read.php?2,99853,100085#msg-100085)**
>
> Hi, 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 fa

---

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 20, 2010, 12:32pm UTC](https://www.ruby-forum.com/t/apc-php-cgi-shared-between-child/190363/4 "2010-06-20T12:32:21Z")

</div>

On Friday of June 18 2010, nfn wrote:

> Is APC shared between php-cgi child processes?

You may read this stuff:  
[http://ivoras.sharanet.org/blog/tree/2010-06-16.php-apc-and-shared-memory.html](http://ivoras.sharanet.org/blog/tree/2010-06-16.php-apc-and-shared-memory.html)

## regards

Marcin G., PGP 0x9F183FA3  
jabber jid:removed\_email\_address@domain.invalid, gg:2532994  
[http://the.fork.pl](http://the.fork.pl)

---

<div class="post-metadata">

**Author:** ![nfn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b19c9b/32.png) [@nfn](https://www.ruby-forum.com/u/nfn)\
**Post date:** [June 20, 2010, 3:58pm UTC](https://www.ruby-forum.com/t/apc-php-cgi-shared-between-child/190363/5 "2010-06-20T15:58:22Z")

</div>

> On Friday of June 18 2010, nfn wrote:
> 
> > Is APC shared between php-cgi child processes?
> 
> You may read this stuff:  
> [http://ivoras.sharanet.org/blog/tree/2010-06-16.php-apc-and-shared-memory.html](http://ivoras.sharanet.org/blog/tree/2010-06-16.php-apc-and-shared-memory.html)

I think it gives somewhat wrong impression (at least the author hasnt  
given  
explanation what way he runs the php - fastcgi itself doesnt tell a lot)  
as  
when you use the some kind of process manager (and don’t spawn the  
processes  
from webserver on each request) the shared memory is really shared (egg  
the  
mapping is done in the master process).

Can read also the comment from the linked bug in the article  
[PHP :: Request #57825 :: share cache between FAST CGI processes](http://pecl.php.net/bugs/bug.php?id=11988) (at bottom) ( '[2010-06-13  
23:45  
UTC] rasmus at php dot net ’ )

rr
