Memcached Object Cache
Shared Memcached Servers - wrong content retuned? (3 posts)

  1. linickx
    Posted 5 years ago #


    I have the following senario, two separate/different WordPress installs on dedicated servers; both have hyperdb (and wp-supercache) installed. The database for both WP sites is on the same master/slave deployment of mySQL (different DBs obviously).

    One WP install hammers the mysql cluster causing performance issues for both sites.

    It has been suggested to install memcached, which we have done in a similar fashion to mySQL, both website share the memcached cluster... IE in the wp-config.php of both sites we have set the following:

    $memcached_servers = array('default' => array('mem1:11211', 'mem2:11211'));

    However I think I've seen instances where by WP Site1 is showing content of WP Site2 ... probably due to WP Site2 storing the data on the memecached cluster with a given key and WP site1 looking for the same key.... since the WP installs are separate the content is completely different thus causing a problem.

    Looking at the plugin code I believe this is resolved by using the blog_id global variable, but I cannot work out if this is set by default - and I need to change it on one WP install or if I need to set it... i.e. is it a numberic value?

    I've attempted an ascii drawing of what we have, any advise would be appreciated.


    +------+  +------+
    | mySQL|  | mySQL|
    +------+  +------+
         |        |
         |        |          |         |
     +------+  +------+  +------+  +------+
     |  WP1 |  | WP2  |  | Mem1 |  | Mem2 |
     +------+  +------+  +------+  +------+
         |         |
  2. Don Daniello
    Posted 4 years ago #

    I know that long time passed, but if anyone needs to have a working plugin for many wordpress blogs using one shared memcached server, here is the version modified by me:

  3. Matt Martz
    Plugin Author

    Posted 4 years ago #

    The problem is that the memcached object cache drop in, currently uses the table prefix to differentiate sites. If you use the same table prefix for multiple sites you will run into issues.

    It has been on my mind to make the keys more unique, so perhaps I'll get around to it soon.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Memcached Object Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic