LUDA: Boost LSM Key Value Store Compactions with GPUs

Peng Xu, Jiguang Wan, Ping Huang, Xiaogang Yang, Chenlei Tang, Fei Wu, Changsheng XiearXiv 2020

Abstract: Log-Structured-Merge (LSM) tree-based key value stores are facing critical challenges of fully leveraging the dramatic performance improvements of the underlying storage devices, which makes the compaction operations of LSM key value stores become CPU-bound, and slow compactions significantly degrade key value store performance. To address this issue, we propose LUDA, an LSM key value store with CUDA, which uses a GPU to accelerate compaction operations of LSM key value stores. How to efficiently parallelize compaction procedures as well as accommodate the optimal performance contract of the GPU architecture challenge LUDA. Specifically, LUDA overcomes these challenges by exploiting the data independence between compaction procedures and using cooperative sort mechanism and judicious data movements. Running on a commodity GPU under different levels of CPU overhead, evaluation results show that LUDA provides up to 2x higher throughput and 2x data processing speed, and achieves more stable 99th percentile latencies than LevelDB and RocksDB.

Introduction

Key-Value (KV) stores are fundamental to modern data center infrastructure. Many popular implementations, such as LevelDB and RocksDB, utilize Log-Structured Merge (LSM) trees to optimize write performance. In an LSM-tree, updates are batched into levels of Sorted String Tables (SSTs). To maintain read efficiency and reclaim space, these systems perform periodic "compaction" operations, which involve merging, sorting, and deduplicating data across levels.

Historically, compaction was limited by the I/O throughput of hard disk drives. However, the emergence of ultra-fast storage technologies like NVMe SSDs and Intel Optane has shifted the bottleneck. As storage I/O speeds have increased, the computational overhead of compaction—including CRC32 checksums, Bloom filter generation, and sorting—has made the process CPU-bound. This is particularly problematic in multi-tenant environments where CPU resources are shared.

Impact of CPU overhead on compaction performance.

As shown in Figure 1, when CPU overhead from other applications increases, the running time for compaction grows disproportionately compared to the data size, confirming that the CPU is the primary performance choke point in modern high-speed storage environments.

LUDA Architecture

To address this bottleneck, we propose LUDA, a GPU-accelerated LSM-tree framework. LUDA offloads the compute-intensive phases of compaction to the GPU using CUDA. The system architecture is designed to maximize parallelism while minimizing the overhead of data transfers between the host (CPU) and the device (GPU).

LUDA's end-to-end compaction workflow between Host and GPU.

The LUDA workflow, illustrated in Figure 6, consists of several key stages:

  1. Parallelized Unpacking: LUDA uses custom CUDA kernels to restore KV pairs from SST blocks and verify data integrity via CRC32 in parallel.
  2. Lightweight Tuple Sorting: To avoid moving large values across the PCIe bus unnecessarily, LUDA creates small <Key, Value_offset> tuples. These tuples are sorted using a cooperative mechanism between the GPU and CPU.
  3. Parallelized Packing: Once sorted, the GPU builds new data blocks, calculates shared keys, and generates Bloom filters simultaneously across thousands of threads.
  4. Asynchronous Pipelining: LUDA overlaps data movement with kernel execution to ensure high hardware utilization.

Evaluation and Results

We evaluated LUDA using the YCSB benchmark (Workload A) on a system equipped with an Intel Optane 900p SSD and an NVIDIA GTX 1080Ti. We compared LUDA against standard LevelDB and a multi-threaded RocksDB configuration under varying levels of simulated CPU stress.

The results demonstrate that LUDA is significantly more resilient to CPU resource contention. Under 80% CPU overhead, LUDA provides approximately 2x the throughput of the baseline systems. Furthermore, LUDA achieves a 2x improvement in data processing speed and maintains much more stable 99th percentile (tail) latencies. While traditional KV stores suffer from latency spikes during heavy compaction cycles, LUDA's offloading strategy keeps the latency curve relatively flat.

Conclusion and Future Work

LUDA successfully demonstrates that offloading LSM-tree compaction to GPUs can overcome the CPU bottlenecks inherent in modern high-performance storage environments. By exploiting data independence and implementing judicious data movement strategies, LUDA provides superior throughput and stability. Future work will focus on integrating GPUDirect Storage to bypass host memory entirely and implementing GPU-native compression algorithms to further enhance performance.

Summary updated

BibTeX
@misc{xu2020luda,
  author = {Peng Xu and Jiguang Wan and Ping Huang and Xiaogang Yang and Chenlei Tang and Fei Wu and Changsheng Xie},
  title = {{LUDA: Boost LSM Key Value Store Compactions with GPUs}},
  year = {2020},
  eprint = {2004.03054},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.03054},
}
Figure