2019-04-19 06:45:00 +08:00
|
|
|
===================
|
|
|
|
Switching Scheduler
|
|
|
|
===================
|
|
|
|
|
2007-10-15 19:22:26 +08:00
|
|
|
Each io queue has a set of io scheduler tunables associated with it. These
|
|
|
|
tunables control how the io scheduler works. You can find these entries
|
2019-04-19 06:45:00 +08:00
|
|
|
in::
|
2007-10-15 19:22:26 +08:00
|
|
|
|
2019-04-19 06:45:00 +08:00
|
|
|
/sys/block/<device>/queue/iosched
|
2007-10-15 19:22:26 +08:00
|
|
|
|
|
|
|
assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted,
|
2019-04-19 06:45:00 +08:00
|
|
|
you can do so by typing::
|
2007-10-15 19:22:26 +08:00
|
|
|
|
2019-04-19 06:45:00 +08:00
|
|
|
# mount none /sys -t sysfs
|
2007-10-15 19:22:26 +08:00
|
|
|
|
2019-06-12 14:50:09 +08:00
|
|
|
It is possible to change the IO scheduler for a given block device on
|
|
|
|
the fly to select one of mq-deadline, none, bfq, or kyber schedulers -
|
|
|
|
which can improve that device's throughput.
|
2006-04-19 15:23:09 +08:00
|
|
|
|
2019-04-19 06:45:00 +08:00
|
|
|
To set a specific scheduler, simply do this::
|
2006-04-19 15:23:09 +08:00
|
|
|
|
2019-04-19 06:45:00 +08:00
|
|
|
echo SCHEDNAME > /sys/block/DEV/queue/scheduler
|
2006-04-19 15:23:09 +08:00
|
|
|
|
|
|
|
where SCHEDNAME is the name of a defined IO scheduler, and DEV is the
|
|
|
|
device name (hda, hdb, sga, or whatever you happen to have).
|
|
|
|
|
|
|
|
The list of defined schedulers can be found by simply doing
|
|
|
|
a "cat /sys/block/DEV/queue/scheduler" - the list of valid names
|
2019-04-19 06:45:00 +08:00
|
|
|
will be displayed, with the currently selected scheduler in brackets::
|
2006-04-19 15:23:09 +08:00
|
|
|
|
2019-04-19 06:45:00 +08:00
|
|
|
# cat /sys/block/sda/queue/scheduler
|
|
|
|
[mq-deadline] kyber bfq none
|
|
|
|
# echo none >/sys/block/sda/queue/scheduler
|
|
|
|
# cat /sys/block/sda/queue/scheduler
|
|
|
|
[none] mq-deadline kyber bfq
|