Memcached stats 命令

stats 查看全局运行指标(连接、命中率、内存)。

Beginner
Key Pointsstats 的 get_hits / get_misses 之比就是缓存命中率,最该盯的指标。

关键指标

Shell
stats
Output
STAT pid 1234
STAT uptime 3600
STAT curr_connections 5
STAT cmd_get 1000
STAT cmd_set 200
STAT get_hits 850
STAT get_misses 150
STAT bytes 4096
STAT limit_maxbytes 67108864

命中率

Hit rate = get_hits / (get_hits + get_misses) = 850/1000 = 85%. A low rate means the cache isn't shielding the DB — TTL too short, or keys vary every request.

limit_maxbytes is the -m cap; bytes is current usage. As usage nears the cap, LRU eviction kicks in and hit rate fluctuates. Watch both together.

Friends & Partners