Memcached仅使用64兆字节,而配置为使用8GB

时间:2016-11-28 13:48:20

标签: memcached

在我们的/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

但是当我telnet到它并询问字节和驱逐时,我看到了我不喜欢的数字(粘贴所有内容,因为它可能有助于调试):

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(谷歌转换器)仅为64mb,这是默认值。

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

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

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

在rails控制台中,当我运行Rails.cache.stats时,我也得到少量字节(64mb)。

如何解决这个问题的任何想法?

1 个答案:

答案 0 :(得分:0)

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