在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"但似乎CentOS 7已经把ktune抛在后面了。我看到一个替代的方法来更改默认的I/O调度程序:
将
elevator参数添加到/etc/default/grub文件中的GRUB_CMDLINE_LINUX行。
# cat /etc/default/grub
...
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg00/lvroot rd.lvm.lv=vg00/lvswap elevator=noop"
...而且还在继续。但这将是一个全系统的变化。我正在寻找一个解决方案,就像我在CentOS 6中一样,可以指定哪些块设备将获得由ELEVATOR参数指定的I/O调度程序。我希望可以将elevator_tune_devs参数添加到GRUB_CMDLINE_LINUX行中,但是根据这,没有这样的内核参数。我知道我能做到
echo 'noop' > /sys/block/hda/queue/scheduler举个例子,但我希望能有一些东西能在重启过程中持续。到目前为止,最好的解决方案是将echo命令放在一个一次性服务中,以便每次启动时都能运行,但我希望有一种类似于CentOS 6解决方案的更干净的方法。
发布于 2019-11-26 23:24:18
您至少有两种方法:
disk选项中使用自定义调优配置文件/etc/rc.local中插入"echo noop“命令或创建特定的systemd服务。编辑:在这里您可以找到一个示例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正如在上面链接的RHEL调优指南中所描述的,定义设备列表有不同的可能性:
sd*);https://serverfault.com/questions/993402
复制相似问题