Mooncake enables Moonshot AI’s Kimi service to handle 75% more requests on real production traces (and up to 525% higher throughput in simulated long-context benchmarks) by turning cluster-wide CPU DRAM, SSDs, and RDMA links into a disaggregated KVCache fabric between separate prefill and decode pools. Developed by Ruoyu Qin, Zheming Li, Weiran He, Mingxing Zhang, Yongwei Wu, Weimin Zheng, and Xinran Xu (Moonshot AI and Tsinghua University), Mooncake shifts scheduling from compute-first to cache-first while introducing prediction-based early rejection for overloaded production clusters.

Long-context chat workloads invert normal serving assumptions: in Moonshot AI’s open-sourced 1-hour Kimi trace (23,608 requests), prompts average 8,590 tokens against just 182 output tokens, and over 50% of cached prefix blocks go unused while hot system prompts get hit tens of thousands of times. Under a 30s time-to-first-token (TTFT) and 0.1s time-between-tokens (TBT) budget on 20 instances, vLLM satisfies TBT for only 57% of requests, whereas Mooncake-[10P+10D] satisfies nearly 100%.

  • 75% real-workload gain: Replaying production timestamps across 10 prefill and 10 decoding instances handles 75% more SLO-compliant requests than 20 colocated vLLM instances.
  • 20% to 525% long-context gains: On 4-node clusters ([3P+1D] vs. vLLM-[4M]), Mooncake lifts SLO-compliant throughput 20% on ArXiv Summarization (0% reuse), 40% on L-Eval (over 80% reuse), and 50% to 525% on 16k to 128k simulated prompts (50% cache reuse).
  • 14.7x lower mean TTFT via cache-aware routing: On an 8P+8D trace replay, KVCache-centric scheduling cuts mean TTFT from 92.07s (random) and 60.41s (load-balancing) down to 6.26s.
  • 55% max trace reuse under LRU: Prefix hit rate across 512-token chained-hash blocks rises from 34% (1,000 blocks) to 55% (50,000+ blocks), motivating hot-spot replication to prevent RDMA bottlenecks.
Mean TTFT across prefill scheduling policies (8P+8D cluster, 23,000 real requests)
Random selection92.07s
Load-balancing only (lightest instance)60.41s
Cache-aware scheduling (reuse + queue time)14.36s
KVCache-centric (cache-aware + hot-spot replication)6.26s (14.7x faster)

Lower TTFT is better. Source: Qin et al. (2024/2026), Section 6.2 and Figure 8.

How It Works

Mooncake separates each cluster into prefill GPU nodes, decoding GPU nodes, and a distributed CPU/DRAM/SSD KVCache pool accessed by an RDMA Messenger service (800 Gbps inter-node RDMA on 8x A800-80GB servers). Each 512-token block carries a chained prefix hash Hash(prev_hash + tokens) (analogous in reuse goals to SGLang RadixAttention across nodes).

A central Conductor pairs each request with a prefill and decode instance and runs four pipelined steps:

  1. Prefix cache reuse and hot-spot migration: Conductor scores prefill nodes by T_transfer + T_queue + T_prefill. If the best-matched node is overloaded and the remote prefix exceeds the local hit by a threshold, another prefill node pulls and replicates those blocks locally, automatically spreading hot system prompts.
  2. Chunked Pipeline Parallelism (CPP): For prompts exceeding prefill_chunk (over 1,000 tokens), Mooncake pipelines chunks across multiple prefill nodes, communicating only at stage boundaries instead of incurring cross-node tensor-parallel all-reduces or per-layer sequence-parallel traffic.
  3. Layer-wise async KV streaming: Prefill nodes overlap asynchronous KVCache loads and stores per transformer layer with forward compute, freeing GPU VRAM immediately so prefill scheduling is bounded only by host DRAM and cache placement.
  4. Continuous decoding: Once the decoding node’s CPU DRAM receives the full KVCache, the request joins a continuous decoding batch up to the TBT SLO and VRAM ceiling.
Why Mooncake predicts decoding load before accepting prefills (2x overload trace)
Late decode rejection
4,183 requests rejected

Prefill runs first, then the decode pool rejects overloaded requests, burning prefill GPU cycles on work that never finishes.

Naive Early Rejection
3,771 requests rejected

Checking current decode load upfront saves prefill waste, yet time lag causes anti-phase prefill/decode load oscillations.

Prediction-based Early Rejection
3,589 requests rejected (-14.2%)

Models future decode batch load after prefill finishes using a uniform decode duration td, smoothing cluster utilization.

8P+8D cluster replaying 23,000 real requests at 2x speed. Source: Qin et al. (2024/2026), Section 7 and Table 3.

Key Findings

Under P90 SLO targets (10x baseline TTFT and 5x baseline TBT), Mooncake-[3P+1D] outperforms vLLM-[4M] across both public and synthetic long-context workloads. On 16k to 128k simulated prompts, long prefills force vLLM to process requests one by one to protect TBT, whereas Mooncake isolates decode batches cleanly and yields 50% to 525% higher throughput.

Overload experiments expose a counterintuitive trap in disaggregated clusters: checking current decode load before starting prefill (“Early Rejection”) induces severe anti-phase oscillations because prefills admitted while decode is quiet all arrive at decode together, triggering blanket rejections while prefill drains. Adding system-level future decode load prediction dampens the oscillation and cuts rejected requests by 14.2% (4,183 down to 3,589) on a 2x-accelerated 23,000-request trace.

Caveats and Builder Takeaway

  • Dummy model and fast RDMA hardware: To protect proprietary weights, all reported runs used a dummy LLaMA2-70B-shaped model and anonymized traces on 800 Gbps RDMA nodes; lower-bandwidth Ethernet clusters face tighter KV transfer limits than DistServe or Splitwise assume.
  • Static P/D ratios can skew TTFT: In public dataset tests, Mooncake-[2P+2D] trailed vLLM-[4M] on TTFT because two prefill nodes were undersized relative to two decode nodes; dynamic role conversion remains future work.
  • Limited reuse ceiling and coarse overload model: Even with infinite cache capacity, Kimi’s general trace topped out at 55% prefix reuse (vs. up to 90% in paper-chat), and overload admission still relies on a uniform decode duration td rather than per-request output length prediction.

For teams serving long-context workloads with reusable prefixes and frequent traffic spikes, Mooncake demonstrates that disaggregated KV storage and load-predictive admission matter just as much as separating prefill and decode GPUs.