Memcached uses distributed consistent hashing to choose which server to put a key on but which hashing algo does it use to map string key into the final hash on which the Ketama algo is applied for server selection. And how good is that algo at spreading similar keys to different servers.
Memcached uses distributed consistent hashing to choose which server to put a key on
Share
According to the source code in hash.c, memcached uses the following algorithm:
From Bob Jenkins’ website:
Also, his requirements are:
To get back to your other question, he measured the ability of the algorithm to uniformly distribute hash values, so I would presume that the hash does a good job at spreading similar keys to different servers. If you have concerns, the code is isolated so you should be able to run your own tests.