Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter cms_

    (@cms_)

    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.

    Thread Starter cms_

    (@cms_)

    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.

    Thread Starter cms_

    (@cms_)

    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.

    cms_

    (@cms_)

    As I had the same problem and found the solution, I thought it best to share it here given the high search rank of this page.

    If you get blank pages or otherwise have trouble importing a w3-total-cache-config.php, you can upload it manually to your wp-content directory. Make sure it’s readable by your web server.

    Referring to the author’s website forum, there is information on how to make WP-PostRatings work with WP-SuperCache. This might be helpful.

    https://forums.lesterchan.net/index.php?topic=4281.0

Viewing 5 replies - 1 through 5 (of 5 total)