I have servers and 1 memcached server linked by the network. When I add 2 memcached on the 2 servers, locally, it's drastically faste !

So I've configured Drupal to use memcached on, except for sessions. The sessions are the only data hosted on the network server (MC 3).

 MC 1         MC 2
   \            /
    \          /
     \        /
        MC 3

It's fine, except for the cache flush because when I do a drush cc all, Drupal 1 will only flush MC1, and Drupal2 only MC2, but not both.

The idea is to force Drupal to clear all the memcached, but to use only the localhost + MC3.

What is your advice, add a hook to clear both servers?

1 Answer 1


I suggest you to use Drush aliases.

Here is the quote from the documentation http://drush.org/en/master/usage/#site-aliases

Drush lets you run commands on a remote server, or even on a set of remote servers. Once defined, aliases can be references with the @ nomenclature

Also from here https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.aliases.drushrc.php

Alias groups (aliases stored together in files called GROUPNAME.aliases.drushrc.php, as mentioned above) also create an implicit namespace that is named after the group name.

Finally, these are few simple steps to achieve what you want:

  • Create production.aliases.drushrc.php file
  • Put in this file aliases for both Drupal 1 and 2
  • Then you can clear cache on all site at once with drush @production cc all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.