Support » Plugin: APC Object Cache Backend » Combining WP's APC object cache with W3TC's APC object caching: good or bad?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Upon further inspection, it appears W3TC swaps in its own object-cache.php provider. With very low fragmentation, it appears to perform better than WP’s own APC object cache drop-in.

    so if I use W3TC, you don’t recommend using APC object cache?

    Short answer: It depends.

    Give APC object caching a try, and monitor it with the included apc.php. APC object cache will be a bit faster, but if/when PHP segfaults/dies, you will lose all your cached objects. Memcache will persist if PHP goes down, but is a bit slower.

    so let’s say i only use currently W3TC… For best performance I must either use APC or Memcache together with W3TC ?

    Been having some server nightmares with it going down with spike loads..

    Dealing with traffic spikes can be tricky, especially if you’re making a bunch of unnecessary database calls for each page view. Every site is different, so your solution will be one you must find yourself. APC is good for PHP opcode caching (PHP code compiled in memory). APC also does object (key/value) caching, and can be faster than memcached if your PHP is stable.

    If you get a lot of segfaults with PHP, as can happen when loading multiple extensions and under heavy load, you might be better off with the stability of memcached. It runs in its own box, and you won’t lose your precious object cache if PHP craps out.

    Although reloading the opcode cache does not take much time or resources (files read are kept in memory), rebuilding an object cache can take an hour or more (depending on the size/complexity of the site) while data is read from SQL on disk into the cache. Those queries also take up CPU cycles. Because regenerating an object cache is expensive, stability is key.

    So try out memcached and APC together. Set w3tc to memcached, and use its suggested settings for the memcache PHP module. Start out with a low object TTL and make sure MySQL isn’t spawning too many processes when you get a spike in visitors and competing for memory. Remember that memcached grows its memory consumption as it fills its cache up.

    Trial and error will get you there… just watch closely (or use monitoring) when you have the spikes and adjust the TTL, cache sizes, MySQL connections, PHP processes, etc. until you find the right balance.

    sorry cms_.. this is out of my league 🙁 I am not quite sure I know how to monitor SQL and adjust all the things you mention.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Combining WP's APC object cache with W3TC's APC object caching: good or bad?’ is closed to new replies.