# Memcached Slab Allocation Memory Tuning

> Monitors Memcached slab allocator memory utilization and optimizes item eviction rates. Use when tuning high-speed distributed in-memory cache clusters.

- Skill: `bishnucd/memcached-slab-allocation-memory-tuning` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add bishnucd/memcached-slab-allocation-memory-tuning`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bishnucd/memcached-slab-allocation-memory-tuning/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: Bishnucd (https://skillmd.com/u/bishnucd)
- Updated: 2026-12-03
- Page: https://skillmd.com/skills/bishnucd/memcached-slab-allocation-memory-tuning

---

---
name: memcached-slab-allocation-memory-tuning
description: Monitors Memcached slab allocator memory utilization and optimizes item eviction rates. Use when tuning high-speed distributed in-memory cache clusters.
license: MIT
metadata:
  author: Community List Maintainers
  version: "1.0.0"
  source: "https://github.com/memcached/memcached/wiki/ConfiguringServer#slab-allocator"
---
# Memcached Slab Allocation Memory Tuning

## Overview
Memcached allocates memory in fixed-size slab classes. Poorly tuned chunk growth factors cause slab calcification and premature LRU item evictions even when memory appears available.

## Operational Workflow

1. **Query memcached stats slabs and stats items via telnet or monitoring agent.**:
   - Query memcached stats slabs and stats items via telnet or monitoring agent.

2. **Inspect slab class chunk sizes to match serialized application cache object distributions.**:
   - Inspect slab class chunk sizes to match serialized application cache object distributions.

3. **Adjust chunk growth factor (-f 1.25) to smooth out item size transitions between slabs.**:
   - Adjust chunk growth factor (-f 1.25) to smooth out item size transitions between slabs.

4. **Enable slab reassign and slab automove to allow Memcached to reclaim memory from empty slabs.**:
   - Enable slab reassign and slab automove to allow Memcached to reclaim memory from empty slabs.

## Recommended Tools & Environments
- Memcached
- Slab Allocator
- In-Memory Cache
- Memory Tuning

## Verification & Execution Criteria
- Pre-execution validation verifies all prerequisites and inputs.
- Step-by-step progress logging confirms intermediate state transitions.
- Post-execution checks verify output integrity and clean exit codes.

