Memcached stats slabs 命令

stats slabs 看内存分配(slab 是固定大小的内存块)。

Beginner
Key PointsMemcached 按 slab class 分组分配内存,每组存某一尺寸区间的对象。

用法

Shell
stats slabs
Output
STAT 1:chunk_size 96
STAT 1:chunks_per_page 10922
STAT 1:total_chunks 10922
STAT 1:used_chunks 5
STAT 1:free_chunks 10917

Memcached splits memory into slab classes, each with fixed-size chunks (e.g. 96 bytes); objects land in the matching class. A full class allocates another page, but classes don't share memory — the classic source of internal fragmentation.

With highly varied value sizes you can see 'evictions while total memory isn't full' — one class is full while others are empty. Keep value sizes reasonable and avoid huge keys.

Friends & Partners