question regarding memory usage

Evert | Rooftop evert at
Fri Sep 7 22:47:56 UTC 2007

Bill Marcum wrote:
> I'm considering using memcached for our php application.  We have certain large objects we retrieve on almost every request, and I'd
> like to optimize the retrieval and the memory required to load these objects every time.  I see the following on the site:
>> The first thing people generally do is cache things within their web processes. But this means your cache is duplicated 
>> multiple times, once for each mod_perl/PHP/etc thread. This is a waste of memory and you'll get low cache hit rates. 
> My question: since most requests retrieve these objects, isn't it true that I'm still going to duplicate the object multiple times, once
> for each PHP thread?  All I'm doing is replacing a mysql call with a memcached call.  
> I'm thinking that what I really need is a PHP module that supports synchronized read/write access to a single memory object from  
> multiple threads.  But I don't see any PHP modules out there that appear to do this.
> Am I missing the point here?
Memcache only starts to make sense when you make use of multiple boxes. 
If you are dealing with just one box I'd absolutely recommend APC for 
caching instead.


More information about the memcached mailing list