Memcached 在配置为使用 8GB 时仅使用 64 兆字节

Memcached using only 64 Megabytes while it's configured to use 8GB

在我们的 /etc/memcached.conf 中,Memcached 配置为使用 8GB 内存

# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
# Note that the daemon will grow to this size, but does not start out holding this much
# memory
-m 8192

但是当我远程登录并请求字节和逐出时,我看到了我不喜欢的数字(粘贴所有内容,因为它可能有助于调试):

Trying ::1...
Connected to localhost.
Escape character is '^]'.
stats
STAT pid 23579
STAT uptime 1392199
STAT time 1480340703
STAT version 1.4.33
STAT libevent 2.0.21-stable
STAT pointer_size 64
STAT rusage_user 690.539930
STAT rusage_system 1084.063224
STAT curr_connections 26
STAT total_connections 14255
STAT connection_structures 84
STAT reserved_fds 20
STAT cmd_get 14934573
STAT cmd_set 8804970
STAT cmd_flush 0
STAT cmd_touch 0
STAT get_hits 6129345
STAT get_misses 8805228
STAT get_expired 14684
STAT get_flushed 0
STAT delete_misses 114360
STAT delete_hits 701
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 58513351245
STAT bytes_written 28630218114
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT time_in_listen_disabled_us 0
STAT threads 4
STAT conn_yields 0
STAT hash_power_level 16
STAT hash_bytes 524288
STAT hash_is_expanding 0
STAT malloc_fails 0
STAT log_worker_dropped 0
STAT log_worker_written 0
STAT log_watcher_skipped 0
STAT log_watcher_sent 0
STAT bytes 64871751
STAT curr_items 16167
STAT total_items 8804970
STAT expired_unfetched 42190
STAT evicted_unfetched 7199999
STAT evictions 8638320
STAT reclaimed 50859
STAT crawler_reclaimed 0
STAT crawler_items_checked 0
STAT lrutail_reflocked 0

如您所见,STAT 字节只有 64871751,AFAIK(google 转换器)只有 64mb,这是默认值。

当我查看 /var/log/memcached 时,我只看到一行条目:

Failed to listen on TCP port 11211: Address already in use

不知何故,我猜测另一个不同的 memcached 实例(使用默认的 64MB)正在阻止正确的实例启动。

在 rails 控制台中,当我 运行 Rails.cache.stats 时,我也得到了那么小的字节数 (64mb)。

有什么解决办法吗?

我们发现服务器上实际上有 2 个 memcached 运行 实例。正在加载的是使用 64mb 默认值。