WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Memcached database caching on a VPS ok? (5 posts)

  1. Chris Brennan
    Member
    Posted 1 year ago #

    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?

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Chris Brennan
    Member
    Posted 1 year ago #

    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?

  3. Mike Bijon
    Member
    Posted 1 year ago #

    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:
    * http://www.mysqlperformanceblog.com/2006/08/09/cache-performance-comparison/
    * http://stackoverflow.com/questions/1794342/memcache-vs-apc-for-a-single-server-site-data-caching

  4. Chris Brennan
    Member
    Posted 1 year ago #

    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?

  5. Mike Bijon
    Member
    Posted 1 year ago #

    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: http://munin-monitoring.org/attachment/wiki/Munin_Template_dynamic/dynamic01.png

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags