Comment 2 for bug 1067242

Revision history for this message
lisei andrei (andrei-7it) wrote : Re: Increment operation causes connection error!

Hi,

I am using the same memcached verision (2.1.0) with libmemcached 1.0.13 and I have the same connection error message when i do multiple increments. I also tested with older versions of libmemcached (1.0.12. 1.0.10, 1.0.8) with the same result.

The problem is that the issue is not easy to reproduce(at least in my environment). I didn't use any negative numbers I started the increment from 0 and i had to let all night long the test incrementing to see the errors next day in the logs.

These are the options and the way I connect to memcached servers:

      private function connect()
        {
                if ($this->_cache === NULL)
                {
                        $poolId = sha1(serialize($GLOBALS['MEMCACHED_SERVERS']));
                        $this->_cache = new Memcached($poolId);

                        if (count($this->_cache->getServerList()) == 0)
                        {
                                $this->_cache->setOption( Memcached::OPT_COMPRESSION, FALSE );
                                $this->_cache->setOption( Memcached::OPT_LIBKETAMA_COMPATIBLE, TRUE );
                                $this->_cache->setOption( Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT );
                                $this->_cache->setOption( Memcached::OPT_CONNECT_TIMEOUT, 500 );
                                $this->_cache->setOption( Memcached::OPT_SEND_TIMEOUT, 1000000 );
                                $this->_cache->setOption( Memcached::OPT_RECV_TIMEOUT, 1000000 );
                                $this->_cache->setOption( Memcached::OPT_POLL_TIMEOUT, 500 );
                                $this->_cache->setOption( Memcached::OPT_NO_BLOCK, TRUE );
                                $this->_cache->setOption( Memcached::OPT_SERVER_FAILURE_LIMIT, 3 );
                                $this->_cache->setOption( Memcached::OPT_BINARY_PROTOCOL, FALSE );

                                $this->_cache->addServers($GLOBALS['MEMCACHED_SERVERS']);
                        }
                }
        }