---
name: "memcached-slab-allocator-tuning"
description: "Eliminate memory fragmentation and achieve sub-millisecond cache latency with Memcached."
metadata:
  author: "Memcached"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "tune memcached slab growth"
  - "monitor memcached evictions"
  - "configure memcached binary protocol"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Memcached Slab Allocation & High-Speed Caching

Configures Memcached for massive key-value caching: sizing slab chunk growth factors (-f), managing memory allocation (-m), configuring binary protocol, and monitoring cache eviction ratios.

## When to Invoke
Invoke this skill whenever you need to:
- tune memcached slab growth
- monitor memcached evictions
- configure memcached binary protocol

## Execution SOP & Rules
1. Start Memcached with tuned allocation: memcached -m 8192 -f 1.15 -n 48 -vv.
2. Inspect slab distribution: memcached-tool 127.0.0.1:11211 display to view slab pages and wasted bytes.
3. Check cache health via stats command looking at get_hits, get_misses, and evictions.
4. Use consistent hashing on the client side to distribute keys smoothly across multiple Memcached instances.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
