In CentOS 6, there was /etc/tune-profiles/my-server/ktune.sysconfig
with this text(I'm referring to the comments that explain what the code is doing):
# 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"
But it seems like CentOS 7 has left ktune
behind. I see an alternate method to change the default I/O scheduler:
Add the
elevator
parameter to theGRUB_CMDLINE_LINUX
line in the/etc/default/grub
file.
# cat /etc/default/grub
...
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg00/lvroot rd.lvm.lv=vg00/lvswap elevator=noop"
...
And it goes on. But this would be a system-wide change. I'm looking for a solution like I had in CentOS 6 where I could specify which block devices would get the I/O scheduler specified by the ELEVATOR
parameter. I was hoping I could just add the elevator_tune_devs
parameter to the GRUB_CMDLINE_LINUX
line, but according to this, there is no such kernel parameter. I know I can do this:
echo 'noop' > /sys/block/hda/queue/scheduler
for example, but I was hoping for something that lasts past the reboot. The best solution so far is to stick that echo
command in a one-shot service so it'd be run every time at boot, but I was hoping for a cleaner method similar to the CentOS 6 solution.