Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
    
Here be dragons! – Tom O'Connor Feb 7 '13 at 9:51
    
Which OS distribution/version/kernel are you using? That's a very pertinent detail! – ewwhite Feb 7 '13 at 9:54
    
I'm using CentOS 6.3 – Nilesh Feb 7 '13 at 9:56
2  
IIRC scheduling is set on the physical devices (sda/sdb/sdc...) not the md dev – symcbean Feb 7 '13 at 10:07
    
@symcbean That thought came to my mind as well. But I was not sure about it that it can't be done. – Nilesh Feb 7 '13 at 10:19
up vote 5 down vote accepted

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

share|improve this answer
    
Thanks. I did it but still the scheduler file for RAID block outputs "none". – Nilesh Feb 7 '13 at 10:14
    
@Nilesh What did you do? – ewwhite Feb 7 '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 7 '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 7 '13 at 10:18
    
Yeah that happened. And I cross checked the sdX scheduler file and they had that change. – Nilesh Feb 7 '13 at 10:20

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

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.