Linux Change The I/O Scheduler For A Hard Disk

ow do I change the I/O scheduler for a particular hard disk without rebooting my Linux server system?

CFQ [cfq] (Completely Fair Queuing) is an I/O scheduler for the Linux kernel and default under many Linux distributions.

Noop scheduler (noop) is the simplest I/O scheduler for the Linux kernel based upon FIFO queue concept.

Anticipatory scheduler (anticipatory) is an algorithm for scheduling hard disk input/output as well as old scheduler which is replaced by CFQ

Deadline scheduler (deadline) - it attempt to guarantee a start service time for a request.

Task: View Current Disk scheduler

Assuming that your disk name /dev/sda, type:
# cat /sys/block/{DEVICE-NAME}/queue/scheduler
# cat /sys/block/sda/queue/scheduler

Sample output:

noop anticipatory deadline [cfq]

Task: Set I/O Scheduler For A Hard Disk

To set a specific scheduler, simply type the command as follows:
# echo {SCHEDULER-NAME} > /sys/block/{DEVICE-NAME}/queue/scheduler
For example, set noop scheduler, enter:
# echo noop > /sys/block/hda/queue/scheduler

我在IBM工作,可以为大家内部推荐IBM各种职位 IBM全球职位尽在以下链接(请在浏览器中打开,QQ/微信 会阻止): http://ibmreferrals.com/ 很乐意为感兴趣的小伙伴分享:我的面试经验^_^ 如需咨询,请邮件发送以下邮箱,有问必回 1026096425@qq.com
原文地址:https://www.cnblogs.com/jackydalong/p/3642597.html