LSM-Cache: An Efficient Log-Structured Merge Hybrid Key-Value Cache for Massive Small Objects
摘要
In recent years, flash has emerged as a cost-efficient solution for KV caches due to its lower price per bit and higher data density compared to DRAM. Given the limited write endurance of flash, many flash-based KV caches adopt a log-structured design to minimize flash writes while relying on in-memory indexes to locate objects. However, caching a large number of small objects with in-memory indexes still consumes too much DRAM. In this paper, we present LSM-Cache, a new hybrid cache designed for caching billions of small objects. LSM-Cache introduces a two-level hash table to reduce the memory overhead of the index and maintain low write amplification. LSM-Cache also employs TTL-aware object placement, storing objects with similar TTLs together to enable efficient object expiration. Experiments with production traces show that LSM-Cache reduces flash writes by 3.08 \(\times \) compared to the state-of-the-art. Furthermore, LSM-Cache increases throughput by 0.33 \(\times \) under read-write balanced workloads and by 5.26 \(\times \) under write-intensive workloads.