Reputation: 20962
I want to have memcached consistant hashing enabled. I've looked at phpinfo(); and I can see the following - last line "memcached.sess_consistent_hash":
memcached
memcached support enabled
Version 2.1.0
libmemcached version 1.0.4
Session support yes
igbinary support no
json support no
Directive Local Value Master Value
memcached.sess_consistent_hash 0 0
Should this be set to one to enable consistant hashing or am I going in the wrong direction with this? I'm using spymemcached. Is there a different way to do this?
thankyou
** Also how do I enable this - I can't find an entry in php.ini
Upvotes: 1
Views: 2747
Reputation: 321
SpyMemcached is a Java library, so I'm not sure how you're integrating with PHP, but you can turn on cosistent hashing in SpyMemcached like so:
ConnectionFactory connFactory = new ConnectionFactoryBuilder()
.setLocatorType(Locator.CONSISTENT).build();
MemcachedClient client =
new MemcachedClient(connFactory, AddrUtil.getAddresses(serverString));
Upvotes: 2