Using PHP, I'm persisting an array in memcached as part of the following process:
The array contains URLs as strings.
The memcached set operation is failing for large array sizes. Most recently it failed for an array containing 78175 URLs.
The error I am getting from memcached is somewhat generic:
Result code: 10
Result message: SERVER ERROR
The libmemcached documentation is of little utility for this particular error.
The code I am using is quite straightforward:
public function save() {
$this->memcached->set($this->key, $this->items);
}
protected function load() {
$this->items = $this->memcached->get($this->key);
if (!$this->items) {
$this->items = array();
}
}
The libmemcached documention is of little immediate help for this error and the error itself is understandably vague.
What can be the causes for memcached error 10?
Error is Memcached::OPT_BUFFER_WRITES - 10
$this->_Memcache =& new Memcached();
$this->_Memcache->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_PHP);
$this->_Memcache->setOption(Memcached::OPT_NO_BLOCK, true);
$this->_Memcache->setOption(Memcached::OPT_TCP_NODELAY, true);
$this->_Memcache->setOption(Memcached::OPT_BUFFER_WRITES, true);
$this->_Memcache->setOption(Memcached::OPT_SERVER_FAILURE_LIMIT,3);
$this->_Memcache->setOption(Memcached::OPT_HASH,Memcached::HASH_CRC);