Liao Xiaojian, Yang Zhe, Yang Hongzhang, Tu Yaofeng, Shu Jiwu. A Low-Latency Storage Engine with Low CPU Overhead[J]. Journal of Computer Research and Development, 2022, 59(3): 489-498. DOI: 10.7544/issn1000-1239.20210574
Citation:
Liao Xiaojian, Yang Zhe, Yang Hongzhang, Tu Yaofeng, Shu Jiwu. A Low-Latency Storage Engine with Low CPU Overhead[J]. Journal of Computer Research and Development, 2022, 59(3): 489-498. DOI: 10.7544/issn1000-1239.20210574
Liao Xiaojian, Yang Zhe, Yang Hongzhang, Tu Yaofeng, Shu Jiwu. A Low-Latency Storage Engine with Low CPU Overhead[J]. Journal of Computer Research and Development, 2022, 59(3): 489-498. DOI: 10.7544/issn1000-1239.20210574
Citation:
Liao Xiaojian, Yang Zhe, Yang Hongzhang, Tu Yaofeng, Shu Jiwu. A Low-Latency Storage Engine with Low CPU Overhead[J]. Journal of Computer Research and Development, 2022, 59(3): 489-498. DOI: 10.7544/issn1000-1239.20210574
1(Department of Computer Science and Technology, Tsinghua University, Beijing 100084)
2(ZTE Corporation, Nanjing 210012)
Funds: This work was supported by the National Key Research and Development Program of China (2018YFB1003301), the National Natural Science Foundation of China (61832011), and the Project of ZTE (20182002008).
The latency of solid-state drive (SSD) has improved dramatically in recent years. For example, an ultra-low latency SSD can process 4 KB data in 10 microseconds. With this low latency, how to reap the I/O completion efficiently becomes an important issue in modern storage systems. Traditional storage systems reap I/O completion through hardware interrupt, which introduces extra context switches overhead and further prolongs the overall I/O latency. Existing work use polling as an alternative to the hardware interrupt, thereby eliminating the context switches, but at the cost of high CPU consumption. This paper proposes a CPU-efficient and low-latency storage engine namely NIO, to take full advantage of the ultra-low latency SSDs. The key idea of NIO is to separate the I/O paths of short I/Os from that of long I/Os; NIO uses classic hardware interrupt for long I/Os, as polling long I/Os does not bring significant improvement but incurs huge CPU overhead; for short I/Os, NIO introduces lazy polling, which lets the I/O thread sleep for a variable time interval before continuously polling, thereby achieving low latency with low CPU consumption. NIO further introduces transaction-aware I/O reaping mechanism to reduce the transaction latency, and a dynamic adjustment mechanism to cope with the dynamic changes of the workload and internal activities of the device. Under dynamic workloads, NIO shows comparable performance against polling-based storage engine while reducing the CPU consumption by at least 59%.