WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. linickx
    Member
    Posted 3 years ago #

    Hello,

    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.

    Cheers,
    Nick

    +------+  +------+
    | mySQL|  | mySQL|
    +------+  +------+
         |        |
    ---------------------------------------
         |        |          |         |
     +------+  +------+  +------+  +------+
     |  WP1 |  | WP2  |  | Mem1 |  | Mem2 |
     +------+  +------+  +------+  +------+
         |         |
    ---------------------
             |
           WWW
  2. Don Daniello
    Member
    Posted 2 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:
    http://dondaniello.com/files/release/object-cache.phps

  3. Matt Martz
    Member
    Plugin Author

    Posted 2 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

About this Topic

Tags