|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-13 18:30 UTC] serhat at sakarya dot nl
Description: ------------ Is it possible to add a Memcache::map_to_server method to be called from PHP? This way, PHP-level code can use the same pool mapping function as is used internally, but apply it to custom situations as well. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 06:00:01 2025 UTC |
Actually pecl/memcache in CVS supports consistent hashing as of yesterday, you can checkout and build a copy like cvs -d :pserver:cvsread@cvs.php.net:/repository checkout pecl/memcache cd pecl/memcache phpize ./configure make && make install You also need to set an INI entry like memcache.hash_strategy = consistent The consistent hash strategy is implemented using CRC32("server:port") instead of using MD5 as libketama or SHA1 as Set::ConsistentHash, though this might change in the future when a standard has been agreed upon. If you want to avoid stale data when servers are flapping the best way would probably be to set the INI entry "memcache.allow_failure" to 0, this disables failover entirely. If data-integrity is extremely important, you could also implement the "status" and "failure_callback" parameters to addServer() in order to track server state in an external database so as to make sure that servers are properly flushed before being used again. //Mikael