Batch-Saturated Single-Thread Throughput in a Redis-Compatible In-Memory KV Store: A Reproducible Model with R 2 ≈ 0.994
Darreck Lamar Bender · 2025
This paper presents a single-thread, Redis-protocol compatible in-memory key-value server that achieves multi-million operations per second per core under pipelined client workloads while remaining mathematically predictable. We model sustained throughput as a function of pipeline depth p using the standard batched-service form T (p) = p/(t 0 + t 1 p) = ap/(1 + bp), where t 0 is fixed per-batch service time and t 1 is marginal per-operation time. Identification on Apple M2 yields t 0 ≈ 5.49 µs/batch and t 1 ≈ 69.6 ns/op, implying T max = 1/t 1 ≈ 14.37 Mops/s. The fit quality is R 2 ≈ 0.994 over the admissible region (fixed payload, no persistence, single thread, NIC unsaturated, pinned clocks). Three invariants are verified: (i) pipeline closure T • p50 s ≤ C • p, (ii) syscall budget syscalls/op ≈ 2/(Cp) arising from one read() and one writev() per flush, and (iii) a tight cycles/op band under fixed payload sizes. Same-box comparisons at C=50, p=100 show per-core uplifts over Redis of 2.11× for the mixed workload presented, with specific configurations achieving up to 2.7× improvement in GET-heavy workloads. We outline the implementation decisions-RESP batch parsing with span extraction, zero-allocation response paths, per-connection ring buffers, vectorized I/O, and a cache-aware hash table-and the methodology required to reproduce all results.