Random add/set errors on Debian/Memcached 1.1.12

Mauro Maggi maggi at goadv.com
Tue Dec 4 14:44:21 UTC 2007

We got some random errors with Memcached 1.1.12 on a (32-bit) production
server running Debian 4.0r1. The client API is the one provided with php

memcache_set() and memcache_add() randomly fail when trying to set large
values ( > 30kb); the larger the entry length, the larger the number of
failures. Moreover, we get random notices like this one: 
"Notice: memcache_get_stats() [function.memcache-get-stats]: Server (tcp 11211) failed with: Failed reading line from stream
(0) in /path/to/script.php"

The same setup on a local developing box, with the same setup, gives us
no failures and everything works ok.

What's wrong in our production box? Is there a way to get an insight on
why the functions are failing, other than their "false" return value?

What follows is the phpinfo() memcached reported configuration and the output of the memcache_get_advanced_server_stats on our production box:

Revision 	$Revision: 1.92 $
memcache.allow_failover	1
memcache.chunk_size	8192
memcache.default_port	11211
memcache.hash_function	crc32
memcache.hash_strategy	standard
memcache.max_failover_attempts	20


Server stats:array(19) {
  string(4) "2735"
  string(6) "355498"
  string(10) "1196778820"
  string(6) "1.1.12"
  string(10) "230.270391"
  string(10) "452.140257"
  string(7) "1012241"
  string(8) "10852467"
  string(10) "1429072369"
  string(3) "469"
  string(7) "6798948"
  string(3) "654"
  string(8) "10898327"
  string(8) "10852467"
  string(7) "8061893"
  string(7) "2836434"
  string(11) "18236447981"
  string(11) "14350735133"
  string(10) "2147483648"

More information about the memcached mailing list