tags:

views:

46

answers:

1

Ive been using memcache before, decided to try out APC. Im having problems with it actually reading values, and respecting the expiry dates. I can set a 10 min expired date on a piece of data. Refresh the page, which will run a mysql query and cache the result into a key. On next load, it checks to see if the key is set, and if it is, it grabs data from it, instead of DB. Except it doesnt always do that... it still runs the query, about 1/2 the time, regardless of the key being set or not. They keys that are set, dont always expire when they are set to expire either either. And the command that deletes a key from the cache, doesn't always do that either.

I havent had these problems with memcache, which performed like clockwork.

A: 

Make sure APC isn't full -- it's possible that your keys are being pushed out of memory. The default configuration on many systems only allocates 32 megabytes, which is actually extremely easy to fill with PHP bytecode alone.

The best way to gain visibility into your APC cache utilization is via the apc.php script that ships with APC.

Frank Farmer