On Sun, Jul 18, 2010 at 01:59, ashish <[email protected]> wrote: > Hi, > > I am new to memcached. I have a doubt about adding a memcached server > instance to current setup. I tried searching the group but couldn't > clear my doubt. > I want to know how to add a new server to a list of servers ? Say I > have 10 servers currently and in future I want to add 2 more servers. > How do I inform all the memcache clients about the addition of this > server? > I am using memcached(Ruby) on libmemcached-C. > > Thanks in advance !
1 - Ensure you are using a hashing algoritm that allows for adding members to the pool without flushing the entire cache due to the change in distribution of the keys. Ketama is one that supports this, you will just loose cache of the % of servers you are adding. 2 - Change your config on the clients to add the new memcache servers. To test 1, I recommend setting up a testing client with the old list of mc servers. Use the client to set 100 keys "testN". Change configuration to add the two new servers. Use the new client to see how many of the 100 keys "testN" are still present. Cache misses should be ~16% in your case (adding 2 servers to a pool of 10) -- Guille -ℬḭṩḩø- <[email protected]> :wq
