Lev*_*ike 2 linux block scheduler grub2 block-device
在 CentOS 6 中,有/etc/tune-profiles/my-server/ktune.sysconfig这样的文字(我指的是解释代码正在做什么的注释):
# This is the I/O scheduler ktune will use. This will *not* override anything
# explicitly set on the kernel command line, nor will it change the scheduler
# for any block device that is using a non-default scheduler when ktune starts.
# You should probably leave this on "deadline", but "as", "cfq", and "noop" are
# also legal values. Comment this out to prevent ktune from changing I/O
# scheduler settings.
ELEVATOR="deadline"
# These are the devices, that should be tuned with the ELEVATOR
ELEVATOR_TUNE_DEVS="/sys/block/{sd,cciss,vd,dasd,xvd}*/queue/scheduler"
Run Code Online (Sandbox Code Playgroud)
但似乎 CentOS 7 已经ktune落后了。我看到了一种更改默认 I/O 调度程序的替代方法:
将
elevator参数添加到文件中的GRUB_CMDLINE_LINUX行/etc/default/grub。
# cat /etc/default/grub
...
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg00/lvroot rd.lvm.lv=vg00/lvswap elevator=noop"
...
Run Code Online (Sandbox Code Playgroud)
它继续。但这将是一个系统范围的变化。我正在寻找一种类似于 CentOS 6 中的解决方案,我可以在其中指定哪些块设备将获得由ELEVATOR参数指定的 I/O 调度程序。我希望我可以将elevator_tune_devs参数添加到GRUB_CMDLINE_LINUX行中,但根据this,没有这样的内核参数。我知道我可以这样做:
echo 'noop' > /sys/block/hda/queue/scheduler
Run Code Online (Sandbox Code Playgroud)
例如,但我希望能在重启后持续下去。迄今为止最好的解决方案是将该echo命令保留在一次性服务中,以便每次启动时都运行它,但我希望有一种类似于 CentOS 6 解决方案的更简洁的方法。
你至少有两种方法:
编辑:在这里你可以找到一个示例tuned.conf文件:
# tuned configuration
[main]
summary=ZFS General non-specialized tuned profile
include=balanced
[disk]
# Comma separated list of devices, all devices if commented out.
type=disk
devices=sda,sdb
elevator=noop
Run Code Online (Sandbox Code Playgroud)
正如我在上面链接的 RHEL 调优指南中所述,您有不同的可能性来定义设备列表:
sd*;| 归档时间: |
|
| 查看次数: |
495 次 |
| 最近记录: |