Memcache configuration options, using multiple memcache servers

Events happening in the community are now at Drupal community events on www.drupal.org.
nadavoid's picture

I'm interested in finding out how people are configuring Drupal sites to make the best use of multiple memcache servers and distinct machines.

Topologies I've seen so far include:

  • replicating the caches to multiple memcache servers
  • storing separate caches on each memcache server.

I would also be interested in your experience or thoughts on using moxi with Drupal.

Some relevant discussions I've found so far include

What I would like to do in this discussion is collect more options, including multiple memcaches with one single apache/php backend.

Comments

It depends.

alanmackenzie's picture

I've not heard of moxi before, looking forward to testing it out sometime soon. Thanks for the heads up.

Straight forward answer is .... it depends.

If you decide on back-end routing by hashing either the URL or Host (in a multi-site environment) the one memcache instance per server would likely out perform the massive multi-node instance due to cache locality.

If you have memcache on the same server as apache make sure to use the -s flag with memcache. Communication via unix sockets has a lower overhead than TCP/UDP.

A large multi-node instance would likely increase your hit ratio and be better in the case where the cache content out-sizes the memory available to one instance as you don't end up with some memcache nodes 'sparse' and the others full. If generating objects to put in the cache is very expensive and they have a long TTL then this option will almost certainly be better in non-hashed routing environments.

Disclaimer: Theory isn't enough always be empirical about this kind of decision.

Thanks! Now for some study...

nadavoid's picture

Alan, Thanks for the reply. Now I need to take some time to digest what you've said. If you happen to see me in IRC (I'm "nadavoid") I would welcome some further discussion.