Title: [Plugin: Memcached Object Cache] Shared Memcached Servers &#8211; wrong content retuned?
Last modified: August 19, 2016

---

# [Plugin: Memcached Object Cache] Shared Memcached Servers – wrong content retuned?

 *  [linickx](https://wordpress.org/support/users/linickx/)
 * (@linickx)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-shared-memcached-servers-wrong-content-retuned/)
 * 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](http://plugins.trac.wordpress.org/browser/memcached/tags/2.0/object-cache.php)
   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
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Don Daniello](https://wordpress.org/support/users/don-daniello/)
 * (@don-daniello)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-shared-memcached-servers-wrong-content-retuned/#post-1923799)
 * 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](http://dondaniello.com/files/release/object-cache.phps)
 *  Plugin Author [Matt Martz](https://wordpress.org/support/users/sivel/)
 * (@sivel)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-shared-memcached-servers-wrong-content-retuned/#post-1923801)
 * 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.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Memcached Object Cache] Shared Memcached Servers – wrong content
retuned?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/memcached.svg)
 * [Memcached Object Cache](https://wordpress.org/plugins/memcached/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/memcached/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/memcached/)
 * [Active Topics](https://wordpress.org/support/plugin/memcached/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/memcached/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/memcached/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Matt Martz](https://wordpress.org/support/users/sivel/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-memcached-object-cache-shared-memcached-servers-wrong-content-retuned/#post-1923801)
 * Status: not resolved