我偶尔会在Memcached中收到错误。
SERVER_ERROR out of memory storing object
我的系统上仍然有足够的内存(5GB)。我的监控插件(Nagios)告诉我,我目前正在使用69%的可用内存用于Memcached(-m 1024
)
这些是统计数据:
STAT pid 26944
STAT uptime 2127214
STAT time 1369169586
STAT version 1.4.13
STAT libevent 2.0.16-stable
STAT pointer_size 64
STAT rusage_user 59272.524301
STAT rusage_system 65565.313576
STAT curr_connections 8
STAT total_connections 51640235
STAT connection_structures 1001
STAT reserved_fds 20
STAT cmd_get 4558313652
STAT cmd_set 3486996973
STAT cmd_flush 0
STAT cmd_touch 0
STAT get_hits 3399062933
STAT get_misses 1159250719
STAT delete_misses 5140552
STAT delete_hits 1062598
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT touch_hits 0
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 1221665161161
STAT bytes_written 372602026218
STAT limit_maxbytes 1073741824
STAT accepting_conns 1
STAT listen_disabled_num 418
STAT threads 4
STAT conn_yields 32569435
STAT hash_power_level 21
STAT hash_bytes 16777216
STAT hash_is_expanding 0
STAT expired_unfetched 195561
STAT evicted_unfetched 0
STAT bytes 745210506
STAT curr_items 3105071
STAT total_items 3486996973
STAT evictions 0
STAT reclaimed 263780
END
我正在使用spymemcached体验这个存储值 - 但我相信它与它无关。
此外,我相信如果我重启memcached服务器,这可以解决。
这不是here中描述的错误,它出现在版本< = 1.4.10中 - 我在Ubuntu 64bit精确版上使用1.4.13。
刚刚发现,我正在使用手册描述为的-M
选项:
Disable automatic removal of items from the cache when out of memory. Additions will not be possible until adequate space is freed up.
所以,我猜memcached服务器的内存确实已满 - 但根据统计数据它不会占用100%的空间 - 为什么会这样?
怎么办?