Quantcast
Channel: Memcache Consistent Hashing, Cluster, PHP code, Ketama and all about it - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Memcache Consistent Hashing, Cluster, PHP code, Ketama and all about it

$
0
0

I have been trying for the whole day to understand and code for Memcache with PHP but I am getting confused at few points. I have gone through many articles and almost every SO questions related this but could not find exact answers.

1) What would be the code to create Consistent Hashed Key in PHP? What libraries I have to install and what I really need to do? Any good article to go through?

2) Suppose, I have successfully stored a Consistent Hashed Key, now if my any of server is down or added a new server would it make any difference even though I am using Consistent Hashed Key etc?

3) Will using Memcached::addServers() instead of Memcached::addServer() make any difference in the case of Consistent Hashing as stated in http://ru.php.net/manual/en/memcached.addserver.php if not then what means?

$m = new Memcached();
$m->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT);
$m->addServers($servers);

4) Is using above code is enough for Consistent Hashing and then adding/removing servers would not make any difference to keys?

5) What is Ketama Library? and why to use it if Memcached::DISTRIBUTION_CONSISTENT can work better? following http://www.last.fm/user/RJ/journal/2007/04/10/rz_libketama_-_a_consistent_hashing_algo_for_memcache_clients

6) Do I have to hash my keys in some way or just provide my key and let the Memcached handle the rest?

Please guys I need your real support to understand and implement it my production environment as soon as possible. Your answers would let me understand what should I code for better.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images