Re: memcache extension improvements (multiple servers, failover, compress threshold)

From: Date: Fri, 21 Oct 2005 11:29:06 +0000
Subject: Re: memcache extension improvements (multiple servers, failover, compress threshold)
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-3132@lists.php.net to get a copy of this message
Hello Mikael. Thanks for the patch, it looks great. I really doubt that I'll keep using/developing/testing PECL/memcache in the nearest future, so I'd like to ask you: would you like to take it over? If you use memcache a lot - it does make sense to me. If yes - please apply for CVS account and I'll assign you as lead developer of PECL/memcache, so you'll be able to upload releases etc. Thanks. On 21.10.2005 01:10, Mikael Johansson wrote:
Code available at http://www.synd.info/extensions/memcache/ Load is distributed to backend servers based on weight, key hashing is done using the new-style crc32 method compatible with other client API's. Failover is transparent; as long as alternate backends exist, client code won't know (other that an E_NOTICE). Failed servers are marked as failed and will be reconnected in X seconds (default 15). 3 new methods: Memcache::addServer(host, port = 11211, persistent = true, weight = 1, timeout = 1, retry_interval = 15) : bool * Persistent connections by default as recommended in the protocol spec * Weight is relative the weight of other servers (p = weight/SUM(weights) when selecting a server given a key) * Socket timeout as in connect()/pconnect() * Retry interval is the number of seconds to wait before attemting to reconnect a failed backend Memcache::getExtendedStats() : array("hostname:port" => array(stats), "failedhost:port" => FALSE, ...) * Returns regular server stats for each backend Memcache::setCompressThreshold(bytes, min_savings = 0.20) : bool * Attempt to compress values automatically if strlen > threshold * Minimum default savings of 20% to actually store compressed Corresponding functions memcache_add_server(handle, ...) memcache_get_extended_stats(handle) memcache_set_compress_threshold(handle, ...) I have been in contact with the current maintainer Anthony Dovgal, who is positive to the changes. More feedback from other users and help with testing would be appreciated. The tests/ folder contain some new unit tests (019-028.phpt) //Mikael Memcache protocol spec http://cvs.danga.com/browse.cgi/wcmtools/memcached/doc/protocol.txt?rev=HEAD&content-type=text/plain
-- Wbr, Antony Dovgal

« previous php.pecl.dev (#3132) next »