Linux IO Scheduler: noop/deadline/cfq/bfq 到 blk-mq


介绍

请参考:https://hzliu123.github.io/linux-kernel/Linux%20IO%20Schedulers.pdf
早期版本(NOOP、CFQ、DEADLINE、BFQ)
论文《Performance comparison and analysis of Linux block I/O schedulers on SSD》

Figure 1. Deadline scheduler.

Figure 2. CFQ scheduler

Figure 3. Noop scheduler.

Figure 4. BFQ scheduler.
结论:
Block devices maintain request queues and approaches to schedule pending read or write requests. The kernel I/O scheduler subsystem is responsible for request optimization. The performance of Deadline, CFQ, Noop, and BFQ block I/O schedulers that are included in the latest Linux 4.1x kernel are compared in terms of throughput this paper. The tests have been carried out on an SSD block devices that are common in ranging from small handheld devices to large-scale data center configurations. According to the test results, each scheduler has different advantages over others. CFQ scheduler is suitable for the systems that require balanced I/O access and do not need process prioritization. Deadline scheduler has better performance on read-intensive works. Noop is for the systems on the cloud or hypervisors. BFQ performs better on interactive use-case scenarios. Noop is the simplest scheduler and it is considered to have the potential for optimized new implementations targeting SSD block devices.
翻译:
块设备维护请求队列,用于调度挂起的读或写请求。内核 I/O 调度子系统负责请求优化。本文基于吞吐量对最新 Linux 4.1x 内核中包含的 Deadline、CFQ、Noop 和 BFQ 块 I/O 调度器的性能进行了比较。这些测试涵盖了小型手持设备到大型数据中心配置中常见的 SSD 块设备。根据测试结果,每个调度器都比其他调度器有不同的优势。CFQ 调度器适用于需要平衡 I/O 访问且不需要支持进程优先级的系统。Deadline 调度器在读密集型工作负载上有更好的性能。Noop 适用于使用了云或虚拟化的系统。BFQ 在交互式场景中表现更好。Noop 是最简单的调度器,它被认为具有针对 SSD 块设备优化的新实现的潜力。
另外几张比较好的图
https://www.thomas-krenn.com/de/wiki/Linux_I/O_Scheduler



调度器使用建议
Linux distribution Default I/O scheduler
Ubuntu Deadline (Since Ubuntu 12.10)
Red Hat Enterprise Linux (RHEL)

Deadline, except for SATA disks

https://access.redhat.com/solutions/32376


新版本(BLK-MQ)
Note: With Linux Kernel 5.0, the previous legacy I/O schedulers listed below were removed from the kernel. As of Linux Kernel 5.0, only the Linux Multi-Queue Block IO Queueing Mechanism (blk-mq) is used.
https://www.thomas-krenn.com/de/wiki/Linux_Multi-Queue_Block_IO_Queueing_Mechanism_(blk-mq)
blk-mq ( Multi-Queue Block IO Queuing Mechanism ) is a new framework for the Linux Block Layer that was introduced with Linux Kernel 3.13 and completed with Linux Kernel 3.16. Blk-mq enables over 15 million IOPS on 8-socket servers for high-performance flash devices (e.g. PCIe SSDs) , but single and dual-socket servers also benefit significantly from blk-mq.  A device is controlled via blk-mq if its device driver is based on blk-mq.

论文:《Do we still need IO schedulers for low-latency disks?》


论文解读:对于超低延迟SSD,IO调度器已经过时了吗?
研究者使用RocksDB键值存储作为宏观基准工具,进一步验证了I/O调度器对超低延迟(ULL)存储设备性能和能耗的影响。具体来说,他们运用db_bench工具生成随机读取键值查找的工作负载,并记录不同I/O深度下的性能表现(以IOPS衡量)以及能量消耗(每百万次IO操作的焦耳数)。结果显示,在各种不同的I/O强度条件下,无论是在读取、写入还是混合(50-50%读写比)场景下,无调度器none模式表现出最优的性能(即最高的IOPS),优于其他三种调度器mq-deadline、kyber和bfq的表现。
总的来说,研究团队通过实验证明,在现今超低延迟存储时代,传统的I/O调度策略不仅没有为性能优化带来帮助,反而增加了延迟并影响到吞吐率及能源效率。这提示我们,对于超低延迟存储设备,应当重新评估I/O调度器的作用,并根据具体应用场景和技术特性来决定是否继续使用它们以改善性能和能效。
到顶部