Monday 2 February 2009

Memcached fails to set cache entry

I was getting an error in memcached (or rather with memcache PECL extension), saying

PHP Notice: MemcachePool::set() [memcachepool.set]: send of 7861 bytes failed with errno=11 Resource temporarily unavailable
This only occurs when you set a cache entry without compression.
memcache extension 1.3.0 claims to fix this (but only seems to address cache payloads of 32768 bytes), but I found this wasnt the case for shorter data.
Also 1.3.0 requires upgrading to memcached 3.0.2 beta to cope with the new binary protocol.

In the end I had to tweak the tcpip settings in /etc/sysctl.conf, adding the following params

net.core.rmem_max = 262144
net.core.wmem_max = 262144
net.core.wmem_default = 262144
net.core.rmem_default = 262144
net.core.optmem_max = 40960
net.core.netdev_max_backlog = 1024
net.ipv4.tcp_wmem = 65536 131072 262144
net.ipv4.tcp_rmem = 16384 174760 349520
net.ipv4.tcp_mem = 196608 262144 393216

No comments:

Post a Comment