Announcing a new memcached client for c++ -- spnetkit
liusifan
liusifan at gmail.com
Sun Feb 17 08:19:40 UTC 2008
Hi,
http://code.google.com/p/spnetkit/
http://spnetkit.googlecode.com/files/spnetkit-0.2.0.src.tar.gz
spnetkit 0.2.0 was released.
Consistent hashing for memcached client was added.
The client uses the following configure file to map key to server.
[EndPointTable]
TableKeyMax = 1000
Server0 = "0-199" 127.0.0.1:11211
Server1 = "200-399" 127.0.0.1:11212
Server2 = "400-599" 127.0.0.1:11213
Server3 = "600-799" 127.0.0.1:11214
Server4 = "800-999" 127.0.0.1:11215
MapKeyToServer steps:
1. Each Server is charged with a range of KeyHash, Server0 is charged with [0, 199], Server1 is charged with [200, 399], etc.
2. KeyHash = hash( key ) mod TableKeyMax ;; in [ 0, 999 ]
3. Find the Server is charged with the KeyHash
liusifan
2008-02-17
More information about the memcached
mailing list