Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_int-memcached

Memcached Internals (Slab Allocator, Multi-Thread LRU & Consistent Hash)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Memcached Internals (Slab Allocator, Multi-Thread LRU & Consistent Hash) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-memcached/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-memcached)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-memcached)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-memcached" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Memcached Internals (Slab Allocator, Multi-Thread LRU & Consistent Hash) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Stateless App Fleet"]
  n1_1["Client Hash Router"]
  n2a_2["Multi-Thread Worker"]
  n2b_3[("Slab Class Allocator")]
  n3_4["Segmented LRU Evict"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Hash key · TCP"| n1_1
  n1_1 -->|"2a. Get/Set · Memc"| n2a_2
  n1_1 -.->|"2b. Alloc slab · RAM"| n2b_3
  n2a_2 -->|"3a. Evict LRU · RAM"| n3_4
  n2b_3 -->|"3b. Sync · Control"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Stateless App FleetSTATELESS
    Sub-ms ephemeral KV cache
  • Client Hash RouterSTATELESS
    Ketama/Maglev shard picker
  • Multi-Thread WorkerSTATELESS
    Libevent epoll + item locks
  • Slab Class AllocatorSTATEFUL
    Pre-sized 1MB pages
  • Segmented LRU EvictSTATELESS
    HOT/WARM/COLD eviction tail
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Stateless App Fleet → Client Hash Router (Hash key)[TCP]
  2. Client Hash Router → Multi-Thread Worker (Get/Set)[Memc]
  3. Client Hash Router → Slab Class Allocator (Alloc slab)[RAM]
  4. Multi-Thread Worker → Segmented LRU Evict (Evict LRU)[RAM]
  5. Slab Class Allocator → Segmented LRU Evict (Sync)[Control]
  6. Segmented LRU Evict → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →