Memcached stats items 命令
stats items 看各 slab 里 item 的数量与最近访问。
Key Pointsstats items 按 slab class 汇总,能看出哪些尺寸的对象占了多少。
用法
Shell
stats itemsOutput
STAT items:1:number 5
STAT items:1:age 120
STAT items:1:evicted 0
STAT items:2:number 3A non-zero
evicted is a red flag — items are being pushed out before expiry (LRU under memory pressure), hurting hit rate. Add memory or shorten TTLs when evicted grows.用法
Shell
stats itemsOutput
STAT items:1:number 5
STAT items:1:age 120
STAT items:1:evicted 0
STAT items:2:number 3evicted 是非零时要警惕——说明内存不够、item 被提前挤出(没等过期就被 LRU 淘汰),会拉低命中率。看到 evicted 增长就该加内存或调小过期。