Roberto Spadim roberto at spadim.com.br
Fri Aug 24 04:59:58 UTC 2007

CHECK WHAT I'M USING WITH PECL: (i just work with one memcache server)
it removed all wrong return from pecl library, since it's don't return 
sometimes and i retry again, if the status of servers are ok and i 
didn't get any return it's because i don't have anything to get

class Memcache_ext{
    private $m;
    private $host;
    private $hostcount=0;
    function Memcache_ext(){
        $this->m=new Memcache;
    function __call($f, $p){
        if ($f!='get' && $f!='set' && $f!='add' && $f!='replace'){
            if ($f=='connect' || $f=='pconnect'){
            if ($c==0)
            elseif ($c==1)
            elseif ($c==2)
            elseif ($c==3)
            elseif ($c==4)
            elseif ($c==5)
            elseif ($c==6)
        if ($this->hostcount!=1){
            if ($f=='set')
            elseif ($f=='add')
            elseif ($f=='replace')
        while ($ret===false){
            if ($f=='set')
            elseif ($f=='add')
            elseif ($f=='replace')
#if ($f=='set'){
#    echo "ret=";var_dump($ret);
            if ($ret!==false)
#echo "st=";var_dump($st);
#echo "$h:$pt\n";
            if (!isset($st["$h:$pt"])){
            }elseif ($st["$h:$pt"]==false){
            if ($fc=='connect')
            $m->setServerParams($h,$pt,$to,15, true);
    function __destruct(){
#$m=new Memcache_ext;
#    $m->set('a','b');
#    print_r($m->get('a'));

Don MacAskill escreveu:
> So we're having rare (maybe a dozen errors per multiple billion 
> requests) errors with the PECL memcached client.  The server failed 
> callback is fired, but the server in question is up, has lots of open 
> connections, etc etc.  Other clients, like our custom PHP client, 
> aren't showing any errors whatsoever.
> Others at the hackathon mentioned similar issues, again only at large 
> scale.
> Since the failback callback only accepts host/port and not other 
> useful data like an error message or even the command that was issued, 
> it's been hard to debug and reproduce in a fixable manner.
> But I'd be all over it if someone could help me track it down.  :)
> Thanks!
> Don
> Mikael Johansson wrote:
>> Hi, pecl/memcache is maintained and the new NON_BLOCKING_IO branch 
>> adds many new features, one of which is more specific error messages. 
>> Other features include UDP support, pipelining and consistent 
>> hashing. But yes, during the summer not much work has been done so 
>> help with stabilizing the new branch and addressing bugs that crop up 
>> would be welcome. //Mikael On Wed Aug 22 11:46 , dormando sent: >- 
>> pecl/memcached needs work, but no one's maintaining it? Are there 
>> >alternatives? The PHP client frontier is mired. I tried to look into 
>> an >error but found the same error message was copy/pasted in nine 
>> different >places in the code. Not worth it. [snip]
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 23/08/2007 / Versão: 
> 5.1.00/5104
> Proteja o seu e-mail Terra: http://mail.terra.com.br/

More information about the memcached mailing list