Can the APC cache be shared among multiple PHP processes running as fastcgi/fcgid?

2.1k views Asked by At

I'm running a LAMP box with PHP running as fcgid. APC is installed and working well. However, each PHP process gets its own cache. This is a problem, because it would make far more sense to have 10 PHP processes with 300MB shared APC cache than 10 PHP processes, each with a redundant 30MB unshared APC cache.

There was a prior thread on this topic 8 months ago (How to share APC cache between several PHP processes when running under FastCGI?) and I am wondering if there have been any developments in this realm since then.

3

There are 3 answers

1
AudioBubble On BEST ANSWER

As far as I know it's still not possible to use shared memory cache with any PHP cacher amongst multiple processes... anyway, unless you're under extremely heavy load you should be fine with separate caches, I suppose, since they'll be filled pretty quickly. And hey, RAM is cheap nowadays!

0
carbocation On

It turns out that this is still not possible if you are truly using different processes: http://pecl.php.net/bugs/bug.php?id=11988 (updated 11/13/2009 by the author of the relevant portion of APC).

0
user5286776117878 On

I was reading about it just minutes ago in the bug tracking of PHP https://bugs.php.net/bug.php?id=57825 it's fixed but you must use spawnfcgi or php-fpm http://php-fpm.org/

Quoted from Ramus

It works fine if you use spawnfcgi or php-fpm. Any process manager that launches a parent process and spawns child processes from that will work fine.