PHP5.5 has ZendOptimizer opcache built in and it seems to work pretty well and the benchmarks seem to give it a slight edge over APC in performance. Great. So APC seems to be on its way out.

My question regards w3 total cache. W3TC has the option to do database and opcode caching using APC, and I had this working more or less fine with the APCu (APC user cache). Its compatibility with opcache wasn't perfect -- for example, you'd get some weird save issues if you didn't make some tweaks to cache invalidation and so forth.

I'm wondering -- is it worth it at all to use APCu for user stored caches for opcache/dbcache? I turned it off and my CPU load seems a little lower and I'm wondering if I'm really accomplishing anything given that Zend opcache is already doing the heavy lifting (is it?).

I prefer the more vanilla install (no APCu) as it's one less thing to worry about. But I wonder if I'm really losing any performance. Thoughts?

2 Answers 2


You seem to be a little confused about what function APCu performs. It only implements key/value store. It performs no opcode caching, since the whole point of APCu is to leave that to new Zend implementation of opcode.

When you use APC(u) and compatible object cache plugin WP switches to storing its cache (which is natively discarded when page load ends) and transients (which are natively stored in database) in it. While not very visible this is major change to how internals tick.

So answer to your question is two-part:

  1. Object cache is highly good idea since it's used by WP big time and memory store is very very fast.

  2. APC(u) is just one of possible backends for object cache and if you are havving issues or concerns about it you could easily explore any alternative (memcached, redis, etc).

  • Thanks. My confusion stems from the fact that W3TC allows you to set up the plugin to do what they call database and opcode caching using APCu. I turned that off when I enabled opcache. I use disk page caching which does the real heavy lifting. Is there any benefit to running APCu for the native WP cache when opcache is enabled? Dec 7, 2013 at 1:30
  • Those are different caches, with different mechanics and different benefits. Caching is not on/off concept.
    – Rarst
    Dec 7, 2013 at 9:37

In general you need to analyze how many hits and misses your cache gets. If you have relatively many misses then the cache is not useful. I think that APC provides this kind of stats.

A page served from the page cache do not use PHP, and therefor the APC user cache, at all. The APC user cache is useful only if you have enough pages generated for logged in or commenting users.

So yes, it is totally possible that APC user cache have always wasted you CPU time even before you have done this change, but it depends on your traffic profile.

Not the answer you're looking for? Browse other questions tagged or ask your own question.