RHEL7:如何配置I / O调度程序

介绍

I / O调度程序用于优化磁盘上的读/写。

RHEL 7中有三种类型的I / O调度程序(也称为I / O电梯

  • CFQC fullly F air Q ueuing)促进来自实时流程的I / O并使用历史数据来预测应用程序是否会在不久的将来发出更多I / O请求(导致轻微的空闲趋势)。
  • 截止时间尝试为请求提供有保证的延迟,尤其适用于读取操作比写入操作更频繁的情况(一个队列用于读取,一个用于写入,I / O根据队列中花费的时间进行调度)。
  • Noop实现了一种简单的FIFO(先进先出)调度算法,并且CPU成本最低。

对于RHEL 7,默认的I / O调度程序现在SATA驱动器的CFQ和  其他所有内容的截止日期 这是因为截止日期优于CFQ以获得比SATA驱动器更快的存储空间

RHEL 7性能调整指南中提供了更多详细信息

Configuration at boot

To define a global I/O scheduler (here cfq) at boot, type:

# grubby --update-kernel=ALL --args="elevator=cfq"

Configuration for a particular disk

To get the current configuration of a disk (here /dev/sda), type:

# more /sys/block/sda/queue/scheduler
noop deadline [cfq]

To assign an I/O scheduler (here deadline) to a particular disk (here /dev/sda), type:

# echo deadline > /sys/block/sda/queue/scheduler

Note: This could be set permanently through the rc-local service.

To check the new configuration, type:

# more /sys/block/sda/queue/scheduler
noop [deadline] cfq

Source: RHEL 7 Performance Tuning Guide.

Additional Resources

You can also read IBM Best Practices for KVM starting at page 25.
RedHat provides some suggestions concerning the I/O scheduler to use in a virtualized environment.

posted @ 2018-11-19 15:57  海东潮  阅读(413)  评论(0编辑  收藏  举报