1

I've created a RAID 5 device block by combining 4 HDDs.

The name of my device is md1.

But the /sys/block/md1/queue/scheduler file outputs "none" on doing cat.

And also after editing it using vim its throwing

/sys/devices/virtual/block/md1/queue/scheduler" E667: Fsync failed

I also tried using sysctl.conf and by adding

block.md1.queue.scheduler = deadline

But again it throws

error: "block.md1.queue.scheduler" is an unknown key

I'm really out of options. Please help me out.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
Nilesh
  • 13
  • 1
  • 4

2 Answers2

5

You can apply the I/O scheduler to the real block devices; e.g. your /dev/sdX devices or default a global append to the kernel boot command line in /etc/grub... (add elevator=deadline)

But since you're using EL6 (Red Hat, CentOS, etc.), the most effective approach would be to use the tuned framework.

In your situation,

yum install tuned tuned-utils

Then choose a profile which will provide the right setting for your application. For instance:

tuned-adm profile throughput-performance

or

tuned-adm profile enterprise-storage

Tuned chart

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Thanks. I did it but still the scheduler file for RAID block outputs "none". – Nilesh Feb 07 '13 at 10:14
  • @Nilesh What did you do? – ewwhite Feb 07 '13 at 10:14
  • I installed and set the profile to throughput-performance and then checked the file /sys/block/md1/queue/scheduler – Nilesh Feb 07 '13 at 10:16
  • Look at the output of when you run `tuned-adm profile throughput-performance`. It will say something like: **Applying deadline elevator: sda sdb sdc sdd [ OK ]**. As I stated in the answer above, the elevator settings are applied to your block devices... your individual disks, NOT the mdX device! – ewwhite Feb 07 '13 at 10:18
  • Yeah that happened. And I cross checked the sdX scheduler file and they had that change. – Nilesh Feb 07 '13 at 10:20
  • Then that's it. That's all you need to do. You are now running the deadline scheduler algorithm. This setting will also survive reboots. – ewwhite Feb 07 '13 at 10:22
-1

print current scheduler for all physical disks

for d in $(find /sys -name scheduler | egrep '(/sd|/hd)'); do echo $d $(cat $d); done

cat /sys/devices/virtual/block/md1/queue/scheduler

[noop] deadline cfq

echo "deadline" > /sys/devices/virtual/block/md1/queue/scheduler

  • This might be somewhat useful, but it doesn't answer the question, and so it should be a comment. Also the explanation is insufficient (the title says "print", but the printing is done in the first line, the last one will modify scheduling). I won't downvote because nobody else mentioned the correct way to modify the scheduler (vim is not recommended). – Law29 Dec 22 '15 at 23:21
  • This doesn't work. As others have said, you need to perform this on the real physical devices, which you would have discovered if you had done the commands in reverse order. Always check your work. The echo in the last line is a no-op. Tested on RHEL7.7 using mdadm-4.1-1 and kernel 3.10.0-1062. – Mike S Jul 01 '21 at 23:41