Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] Memcached database caching on a VPS ok?

  • In the recommended settings W3 says that most of the time people shouldn’t use any database caching, although I found one article saying that it is ok to use as long as you are on your own VPS where you have some dedicated RAM.

    I have a VPS with 1 gigabyte of RAM, and memcached enabled, and I was wondering if it would be ok to use database caching with this setup, or if it will actually slow me down?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Or alternately, if you have a choice between APC or Memcached on a VPS, should you use one of those, or is it better to use no database caching at all normally?

    When W3TC says “most” they’re likely talking about the huge #’s of people on shared hosts without dedicated RAM.

    On a VPS, database caching will help you … as long as you don’t run out of memory:
    * Since the amount of RAM used varies widely on your sites code & plugins, grab the P3 Performance Profiler plugin to check memory use across most of all of your site’s pages (run scan > Advanced Metrics > check avg Memory Usage). Then check your MaxClients in your Apache httpd.conf (you’ll know where to look if you’re not running Apache) and do the math on memory use * clients. Or to be really safe look at the memory_limit in php.ini and then do the math.

    * If there’s enough memory for your Apache clients and MySQL, and other modules, and email services, and anything else you’re running, *plus* the object cache … then you can use APC or memcache|d.

    As for performance … APC will be faster for you:

    * APC can act as both an opcode and object cache. Memcache is just an object cache.
    * APC is an in-process, single-host cache. While memcache is a separate process for distributed hosts, so adds some TCP latency even when it’s running locally.

    …if you have many servers or want to put your object cache on a separate VPS, then memcache will work. But if you have the memory to keep everything on a single server stick with APC.

    Here are some benchmarks:

    I tried enabling APC for database caching for a night, and it seemed like during that time my CPU utilization went up quite a bit, to 50 or 60%. When I switched back to memcached it went back down to normal levels though. Would it be normal to see CPU usage go up when enabling APC for database caching?

    Do you have any charts that show other resources than CPU for that time (bandwidth, disk I/O, and memory)? Without knowing what other activity was happening I can only make guesses.
    * If you’re looking for a resource monitoring tool, Munin:

    Without guessing though, I’d say that if memcached works on your server without problems and helps to speed up your site (are you benchmarking page loads?), then you should stick with memcached.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: W3 Total Cache] Memcached database caching on a VPS ok?’ is closed to new replies.