2019-04-18 22:45:00 +00:00
|
|
|
===================
|
|
|
|
Switching Scheduler
|
|
|
|
===================
|
|
|
|
|
2007-10-15 11:22:26 +00:00
|
|
|
To choose IO schedulers at boot time, use the argument 'elevator=deadline'.
|
2011-11-04 18:22:33 +00:00
|
|
|
'noop' and 'cfq' (the default) are also available. IO schedulers are assigned
|
|
|
|
globally at boot time only presently.
|
2007-10-15 11:22:26 +00: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-18 22:45:00 +00:00
|
|
|
in::
|
2007-10-15 11:22:26 +00:00
|
|
|
|
2019-04-18 22:45:00 +00:00
|
|
|
/sys/block/<device>/queue/iosched
|
2007-10-15 11:22:26 +00:00
|
|
|
|
|
|
|
assuming that you have sysfs mounted on /sys. If you don't have sysfs mounted,
|
2019-04-18 22:45:00 +00:00
|
|
|
you can do so by typing::
|
2007-10-15 11:22:26 +00:00
|
|
|
|
2019-04-18 22:45:00 +00:00
|
|
|
# mount none /sys -t sysfs
|
2007-10-15 11:22:26 +00:00
|
|
|
|
2019-06-12 06:50:09 +00: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 07:23:09 +00:00
|
|
|
|
2019-04-18 22:45:00 +00:00
|
|
|
To set a specific scheduler, simply do this::
|
2006-04-19 07:23:09 +00:00
|
|
|
|
2019-04-18 22:45:00 +00:00
|
|
|
echo SCHEDNAME > /sys/block/DEV/queue/scheduler
|
2006-04-19 07:23:09 +00: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-18 22:45:00 +00:00
|
|
|
will be displayed, with the currently selected scheduler in brackets::
|
2006-04-19 07:23:09 +00:00
|
|
|
|
2019-04-18 22:45:00 +00: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
|