A comprehensive benchmark tool comparing libaio, io_uring, and SPDK engines for storage performance testing
This project compares the performance of three different I/O engines in handling random read, random write, and mixed read-write operations. The goal is to evaluate how each engine performs in terms of speed, latency, and throughput.
We tested three I/O engines:
We tested these engines under different conditions, including with 1 and 4 threads for each engine. The tests measured:
Here are the hardware and test environment details:
Here’s a breakdown of the strengths and limitations of each engine:
libaio is an older Linux I/O library that performs asynchronous operations. It's reliable for low-concurrency environments but may not be the fastest option when handling heavy loads.
io_uring is a more recent I/O interface that reduces kernel overhead and offers better performance, especially in high-concurrency tasks. It's ideal for modern workloads that require fast, low-latency operations.
SPDK is a high-performance, user-space I/O framework designed for NVMe storage systems. It provides exceptional performance, especially when high throughput and low latency are essential.
Based on the benchmarking results, SPDK outperformed both libaio and io_uring in terms of throughput and IOPS, especially when using 4 threads. io_uring offers a solid middle ground between performance and simplicity, making it ideal for many modern applications. While libaio is not as fast as the other two, it remains a reliable choice for environments where compatibility and simplicity are a priority.
Engine | Test Type | IOPS | Latency (µs) | Bandwidth (MiB/s) |
---|---|---|---|---|
libaio | Rand Read (1 thread) | 2583 | 378.95 | 10.1 |
libaio | Rand Write (1 thread) | 1839 | 523.40 | 7.3 |
libaio | Rand Read (4 threads) | 6938 | 40.05 | 27.1 |
libaio | Rand Write (4 threads) | 7730 | 41.16 | 30.2 |
io_uring | Rand Read (1 thread) | 1016 | 970.34 | 4.1 |
io_uring | Rand Write (1 thread) | 1866 | 521.96 | 7.5 |
io_uring | Rand Read (4 threads) | 9058 | 563.12 | 35.4 |
io_uring | Rand Write (4 threads) | 9081 | 514.82 | 35.5 |
SPDK | Rand Read (1 thread) | 258000 | 1.64 | 1007 |
SPDK | Rand Write (1 thread) | 517000 | 1.61 | 2018 |
SPDK | Rand Read (4 threads) | 1065000 | 1.54 | 4160 |
SPDK | Rand Write (4 threads) | 1494700 | 1.71 | 5838 |
libaio | Rand Read (1 thread) - Extra Test | 2583 | 378.95 | 10.1 |
io_uring | Rand Write (4 threads) - Extra Test | 9081 | 514.82 | 35.5 |
SPDK | Rand Write (1 thread) - Extra Test | 517000 | 1.61 | 2018 |
The benchmark results highlight the performance characteristics of each I/O engine:
From the results, it is evident that SPDK provides a significant advantage over libaio and io_uring in terms of IOPS and bandwidth, especially in random read/write tests.
Based on the benchmarking results, it is evident that each I/O engine has its strengths and limitations depending on the specific use case. Below are the key takeaways and insights from the tests:
SPDK stands out as the most powerful I/O engine, particularly for environments that require high throughput and low latency. It significantly outperforms both libaio and io_uring in terms of IOPS and bandwidth, especially when using multiple threads. This makes SPDK an ideal choice for high-performance computing tasks and environments with NVMe SSDs, such as data centers and high-frequency trading systems. However, SPDK requires a more complex setup and is resource-intensive, which may not be suitable for all environments.
io_uring provides a good balance between performance and simplicity. It offers a significant performance boost over libaio, especially in high-concurrency scenarios, without the complexity of SPDK. While not as fast as SPDK, io_uring is still capable of handling high-throughput workloads and is ideal for modern applications, such as databases and web servers, where both speed and ease of integration are important. The requirement for Linux kernel version 5.1 or higher is an important factor to consider when adopting io_uring.
While libaio remains a reliable and well-supported option, it does not offer the same level of performance as io_uring and SPDK, especially when dealing with high loads or multiple threads. However, its simplicity and compatibility make it a suitable choice for environments where performance is not the absolute priority, or for legacy systems where newer technologies like io_uring and SPDK might not be available or necessary.
Choosing the right I/O engine depends on the specific requirements of your environment. SPDK is the clear leader in performance, but it comes at the cost of complexity. io_uring offers an excellent middle ground for modern applications, and libaio remains a solid choice for simpler setups or legacy systems. By understanding the strengths and weaknesses of each engine, you can make an informed decision on which one to use in your specific use case.
Email: asadisobhan10069@gmail.com
Student of 2021, Sharif University of Technology, Iran