LinHES Forums
http://forums.linhes.org/

Where and how to change IO Scheduler on boot by UUID
http://forums.linhes.org/viewtopic.php?f=25&t=24271
Page 1 of 1

Author:  thekingofspain [ Sat Jan 23, 2016 1:27 pm ]
Post subject:  Where and how to change IO Scheduler on boot by UUID

Where and how is proper place to change IO Scheduler so that it is trigger at boot time by UUID or equivalent?

The devices in question moves device letters(/dev/sd?) and are part of raids that mount at boot, used only for myth storage, and formated in XFS. The mythserver code, mdadm, XFS, and default kernel scheduler are adding layers of overhead that seem to cause random locks when recording multiple shows with playbacks mostly around commercial skips.

Failed attempts:
/etc/rc.local --> script works when manual executed
/etc/udev/rule.d/95-io-scheduler.rules --> ENV{ID_FS_UUID_SUB}=="xzy", ATTR{../queue/scheduler}="deadline"
Note ID_FS_UUID & ID_FS_UUID_ENC seem to unique per raid, not raid drive member

Author:  graysky [ Sat Jan 23, 2016 3:03 pm ]
Post subject:  Re: Where and how to change IO Scheduler on boot by UUID

Does LH use systemd? If so:
Code:
/etc/tmpfiles.d/foo.conf
w /sys/block/sda/queue/scheduler - - - - deadline


If not, I don't see why you can't just echo it in your /etc/rc.local

As an aside, were you aware of the scsi_mod.use_blk_mq=1 kernel boot parameter? I do not know what version of the kernel LH ships but that is pretty amazing for SATA drives on modern hardware. See: https://wiki.archlinux.org/index.php/Ma ... schedulers

Author:  jams [ Sat Jan 23, 2016 3:27 pm ]
Post subject:  Re: Where and how to change IO Scheduler on boot by UUID

http://linhes.org/projects/linhes/wiki/FAQ

Instead of rc.local the file to modify is
/etc/runit/1.local

Author:  graysky [ Sat Jan 23, 2016 5:02 pm ]
Post subject:  Re: Where and how to change IO Scheduler on boot by UUID

jams wrote:
http://linhes.org/projects/linhes/wiki/FAQ

Instead of rc.local the file to modify is
/etc/runit/1.local


<<Headsmack>> I remember now, you guys are using runit.

Looks like you're on kernel 3.18.24 currently and I think the scsi_mod.use_blk_mq=1 has been mainlined since 3.16 so the OP might want to give that a shot if hardware is supported. In my tests on an SSD, I found up to 20-ish% improvements. I will search for the data and post here.

EDIT:
On my SSD doing some iobench tests with different schedulers... it really excelled in random writes as you see and was no worse than others in the read, write, and rnd reads.
Image

Raw data: https://gist.github.com/graysky2/4bc78c9d66093427ff73

As with anything, you need to test on your hardware to verify what is best and also, what is best depends on your work loads/use case, etc.

Author:  thekingofspain [ Sat Jan 23, 2016 9:14 pm ]
Post subject:  Re: Where and how to change IO Scheduler on boot by UUID

Thanks, for the info, here is my 1.local script in case anyone needs an example:

Code:
#!/bin/bash
#
# /etc/rc.local: Local multi-user start-up script.
#
UUID_LIST=(
        ata-TOSHIBA_DT01ACA300_457T447GS
        ata-TOSHIBA_DT01ACA300_45ASUU5GS
        ata-Hitachi_HDS723015BLA642_MN1020F0026Y6D
        ata-TOSHIBA_DT01ACA200_Y412Y7VTS
)

declare -i i=0
while [ "${UUID_LIST[$i]}" != "" ]; do
NODE=`ls -l /dev/disk/by-id/${UUID_LIST[$i]} | awk '{ print $NF }' | sed -e 's/[/\.]//g'`
echo deadline > /sys/block/$NODE/queue/scheduler
i=i+1
done

Note I have not rebooted to confirm that the script is triggered, but I am sure it will.

Change your UUID_LIST entries with your own device UUIDs and substitute deadline with noop or another io scheduler.

You can confirm the script was triggered by the following:
Code:
cat /sys/block/sdx/queue/scheduler

where x in sdx is the mapping to a device in the UUID_LIST.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/