vLSM: Low tail latency and I/O amplification in LSM-based KV stores

Giorgos Xanthakis,Antonios Katsarakis,Giorgos Saloustros,Angelos Bilas
2024-07-22
Abstract:LSM-based key-value (KV) stores are an important component in modern data infrastructures. However, they suffer from high tail latency, in the order of several seconds, making them less attractive for user-facing applications. In this paper, we introduce the notion of compaction chains and we analyse how they affect tail latency. Then, we show that modern designs reduce tail latency, by trading I/O amplification or require large amounts of memory. Based on our analysis, we present vLSM, a new KV store design that improves tail latency significantly without compromising on memory or I/O amplification. vLSM reduces (a) compaction chain width by using small SSTs and eliminating the tiering compaction required in L0 by modern systems and (b) compaction chain length by using a larger than typical growth factor between L1 and L2 and introducing overlap-aware SSTs in L1. We implement vLSM in RocksDB and evaluate it using db_bench and YCSB. Our evaluation highlights the underlying trade-off among memory requirements, I/O amplification, and tail latency, as well as the advantage of vLSM over current approaches. vLSM improves P99 tail latency by up to 4.8x for writes and by up to 12.5x for reads, reduces cumulative write stalls by up to 60% while also slightly improves I/O amplification at the same memory budget.
Databases
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: **the problem of high tail latency in Log - Structured Merge - tree (LSM) key - value (KV) storage systems based on LSM**. Specifically, when processing write requests, the existing LSM KV storage systems will cause the tail latency to reach several seconds due to the existence of compaction chains, which makes them perform poorly in user - oriented scenarios. ### Main problem analysis: 1. **High tail latency**: - When processing write requests, the existing LSM KV storage systems have high tail latency due to the existence of compaction chains. Especially under high - load conditions, the tail latency may reach several seconds. - This high tail latency will affect the user experience. Especially in user - oriented scenarios, users are very sensitive to response time. 2. **Trade - off between I/O amplification and memory usage**: - In order to reduce tail latency, some existing designs achieve this by increasing memory usage or increasing I/O amplification, but this will bring additional cost and performance problems. - The paper points out that modern LSM KV storage systems usually reduce tail latency by increasing memory usage or increasing I/O amplification, but these methods cannot optimize all key indicators (such as memory usage, tail latency and I/O amplification) simultaneously. ### Solution: The paper proposes a new KV storage design - **vLSM**, aiming to significantly reduce tail latency without significantly increasing memory usage and I/O amplification. vLSM achieves this goal in the following ways: 1. **Reduce the width of the compaction chain**: - Use smaller SST (Sorted String Table) to reduce the amount of data to be processed for each compaction. - Eliminate traditional tiering compaction and avoid tiering compaction in the L0 layer, thereby reducing the width of the compaction chain. 2. **Reduce the length of the compaction chain**: - Use a larger growth factor Φ from L1 to L2 to reduce the total number of levels. - Introduce overlap - aware variable - size SST (vSST) in L1 to control the overlap between L1 and L2, further reducing the length of the compaction chain. 3. **Optimize the compaction strategy**: - vLSM smartly selects the SST for compaction to ensure that each compaction can effectively release space while minimizing unnecessary compaction operations. ### Experimental results: The paper verifies the effectiveness of vLSM through experiments. The results show that vLSM can significantly reduce tail latency, especially for write and read operations. The P99 tail latency is reduced by 4.8 times and 12.5 times respectively, while maintaining low I/O amplification and memory usage. ### Summary: The core problem of this paper is to solve the high tail latency problem in LSM KV storage systems, and proposes a new design vLSM, which can significantly improve the tail latency performance of the system without affecting memory usage and I/O amplification.