1

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

4

1 に答える 1

2

SpyMemcached は Java ライブラリなので、どのように PHP と統合しているかはわかりませんが、SpyMemcached で次のように一貫性ハッシュを有効にすることができます。

ConnectionFactory connFactory = new ConnectionFactoryBuilder()
        .setLocatorType(Locator.CONSISTENT).build();
MemcachedClient client = 
        new MemcachedClient(connFactory, AddrUtil.getAddresses(serverString));
于 2013-05-04T19:16:23.803 に答える