WordPress.org

Ready to get started?Download WordPress

Forums

Memcached Redux
Installed, ttfb went up 5s (7 posts)

  1. Callum Macdonald
    Member
    Posted 1 year ago #

    I just installed couchbase 2.0.0 dev preview 4 and then installed this plugin. The time to first byte (testing locally with curl) went from ~200ms to ~5.4s. I loaded a few pages, ran a few tests, it didn't appear to be just the first hit, nor the cache warming.

    Any idea what's going on, or how I can go about debugging? This is my first dabble with memcache / couchbase, so I'm at a loss.

    Cheers - Callum.

    http://wordpress.org/extend/plugins/memcached-redux/

  2. BigBlueHat
    Member
    Posted 1 year ago #

    Hey Callum,

    Couchbase provides direct memcached access via a proxy known as Moxi. The advantage being that old code works with Couchbase, the disadvantage being that get_multi requests are slower going through the proxy.

    Additionally, the Couchbase SDK for PHP--which supports a matching API to the memcached PHP extension--provides much faster throughput and simpler node/server management.

    There's a blog post on the Couchbase site about the speed differences:
    http://blog.couchbase.com/client-libraries-couchbase-server

    You can get the latest 2.0-focused SDK at
    http://www.couchbase.com/develop/php/next

    Feel free to join us in #libcouchbase on irc.freenode.net or at the Couchbase Forums:
    http://www.couchbase.com/forums/

    Later,
    Benjamin

  3. Callum Macdonald
    Member
    Posted 1 year ago #

    @BigBlueHat: Thanks for the detailed response, I really appreciate it.

    My page load time went from 200ms to 5 seconds. From reading the blog post it seems to suggest that there could be a 200% improvement using the direct SDK instead of the moxi proxy. However, in this case I went from mysql to couchbase and saw a 25 fold increase in time spent generating a page.

    I tried removing this object-cache.php and instead using the one from the memcached plugin which implements it's own getMulti if I understand correctly. Under those conditions, page load times went to ~3.5s. So memcached-redux = ~5s, memcache = ~3.5s, and mysql is close to 200ms.

    I don't have any kind of code profiler so I'm not clear where the extra time comes from. I'll maybe try replacing couchbase with memcached and see if performance improves, but I'm guessing there's a bigger issue here somewhere.

    Cheers - Callum.

  4. BigBlueHat
    Member
    Posted 1 year ago #

    Yeah...seems there's something larger amiss in all this. What are you putting in memcached/Couchbase currently? Are you writing MapReduce? or just storing objects/images/stuff?

    Thanks for the info, Callum.

  5. Callum Macdonald
    Member
    Posted 1 year ago #

    I'm using this plugin:
    http://wordpress.org/extend/plugins/memcached-redux/

    I think it caches WordPress values from the database, to save on mysql queries. It's a fairly straightforward plugin as far as I'm aware. WordPress has a caching mechanism built in, this plugin simply puts that data into memcached so that it persists between requests. At least, that's my understanding.

    I'd be grateful for any suggestions on how to debug my setup. How do I query the couchbase / memcached server to see what's going on in there for example? Or can I log how long each request takes to be serviced by couchbase? How do I verify how much of its available memory couchbase is using? Stuff like that, I really know nothing about couchbase / memcached.

    Cheers - Callum.

  6. BigBlueHat
    Member
    Posted 1 year ago #

    Callum,

    If you can get to the Couchbase Web Console at http://localhost:8091/ (or whatever domain name you're hosting it at), then you can access the UI-level stats for debugging your cluster.

    Go in to the Web UI, click "Buckets," then click the name of the bucket you're keeping data in ("default" typically). Each stat has a tool-tip that explains what it's about. Additionally, here are the doc pages for a couple of command line tools that ship with Couchbase:
    http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-monitoring-moxistats.html
    http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-monitoring-nodestats.html

    Another tool you can use is cbhealthchecker:
    https://github.com/couchbase/healthchecker

    If you run that, it'll generate an HTML report that's "printer" (and PDF) friendly. If you could generate one of those and put either the HTML or a PDF of it up somewhere, I'd be happy to take a deeper look. The report includes some info on how to fix common setup issues, and that may be all you need.

    Also, how many server nodes are you running?

    Thanks, Callum.

  7. Callum Macdonald
    Member
    Posted 1 year ago #

    Wow, thanks for pointing me to the web interface. It looks like couchbase was not actually configured, I had to tell it where to store data, create an admin password, etc. I'm guessing all the cache attempts timed out, which is probably why page load times went so high.

    Now it's working, I can view data being cached, but page generation time is still a little higher than with straight mysql. Performance does look slightly better using the memcached plugin which implements getMulti() in PHP as I understand it, so that could be moxi at work.

    I also tried uninstalling couchbase and instead installed memcached, very similar performance, still slower than mysql. I think at this point I'll write off this exercise as a useful learning experience, uninstall memcached, and look at alternate performance enhancements.

    Thanks a lot for all the input BigBlueHat, couchbase certainly seems more accessible now.

    Cheers - Callum.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic