views:

384

answers:

2

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 (http://stackoverflow.com/questions/598444/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.

+1  A: 

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!

NTAuthority
Because of this problem I can cache N*30 MB fewer megabytes worth of opcode, where N is the number of fcgid/PHP processes. Instead of caching my most commonly used files N times, I'd rather cache N times as many files to hit the disk even less. The reason I care is that we're under heavy load ;-) RAM is cheap, not free!
jpp
A: 

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).

jpp