3

I created a RAID array using the 2 local SSD drives on a EC2 c3.4xlarge instance.

# mdadm --create /dev/md127 --level=0 --raid-devices=2 /dev/xvdf /dev/xvdg
# mkfs.ext4 /dev/md127
# mkdir /data
# echo 'DEVICE /dev/xvdf /dev/xvdg' > /etc/mdadm.conf
# mdadm --detail --scan >> /etc/mdadm.conf
# echo "/dev/md127   /data       ext4    defaults 1 2" >> /etc/fstab 

The device works great. However, when I am trying to set the I/O scheduler for for the array (as root), the scheduler file doesn't change.

# echo noop >  /sys/block/md127/queue/scheduler
# cat /sys/block/md127/queue/scheduler 
  none

What is the proper way of setting the scheduler, so that last commands output is 'noop'?

BraveHeart
  • 31
  • 3
  • 2
    Try setting it on the underlying devices rather than the multi-device. – Matthew Ife Mar 31 '14 at 19:25
  • Where do you usually set that on RedHat? Tried via /etc/rc.local but after reboot, setting wouldn't take effect on the underlying device. It does if I do it after boot manually, but not in rc.local – BraveHeart Mar 31 '14 at 19:47

1 Answers1

4

Don't do this by hand. I mean, you can globally by appending the kernel boot parameter line. But instead, use the tuned-utils framework to handle this.

yum install tuned tuned-utils

Once installed...

tuned-adm profile virtual-guest 

or make your own profile based on virtual-guest.

In /etc/tune-profiles/virtual-guest, there's a stanza that says:

# This is the I/O scheduler ktune will use.  This will *not* override anything
# explicitly set on the kernel command line, nor will it change the scheduler
# for any block device that is using a non-default scheduler when ktune starts.
# You should probably leave this on "deadline", but "as", "cfq", and "noop" are
# also legal values.  Comment this out to prevent ktune from changing I/O
# scheduler settings.
ELEVATOR="deadline"

Modify to taste and be done!

ewwhite
  • 194,921
  • 91
  • 434
  • 799