Sharing Knowledge | System Admin Articles

Quick HOWTO: Change I/O Scheduler in Linux

I/O schedulers in Linux

noop - It can be helpful for devices that do I/O scheduling themselves, as intelligent storage, or devices that do not depend on mechanical movement
cfq - A fairness-oriented scheduler. It tries to maintain system-wide fairness of I/O bandwidth
deadline - A latency-oriented I/O scheduler. Each I/O request has got a deadline assigned.
as (anticipatory) - conceptually similar to deadline, but with more heuristics to improve performance (It may decrease performance in some cases)

Here is the procedure to change the default I/O scheduler in Linux.

Dynamically setting the default I/O scheduler to a Particular Disk:

echo "scheduler_name" > /sys/block/<Disk_Name>/queue/scheduler

To set I/O scheduler to all the Disk drives on the Linux server:

for disk in `ls -1 /sys/block |egrep '^emc|^sd'`;
echo "deadline" > /sys/block/$disk/queue/scheduler;

To verify the settings:
for dsk in `ls -1 /sys/block |egrep '^emc|^sd'`;
echo -e "$i\t\c";
cat /sys/block/${dsk}/queue/scheduler;
Permanently set the default I/O scheduler in Linux via Grub menu:

Implement permanent setting by adding “elevator=noop” to the default stanza in the /boot/grub/menu.lst file

1. Create backup 
cp -p /boot/grub/menu.lst /boot/grub/menu.lst-backup
2. Update menu.lst 

kernel /vmlinuz- root=/dev/sysvg/root splash=silent splash=off showopts elevator=noop

My Profile PhotoAbout the Author

I'm Parthiban, An UNIX System Admin by Profession. I'm Experienced in Linux/Unix System Administration and Scripting. I have done lot of work on the infrastructure Mgmt side in Linux, UNIX and Windows system administration, Hardware, Storage and Data center. I'm blogging since 2008.
Follow Me On Twitter or On Facebook

1 Comments for "Quick HOWTO: Change I/O Scheduler in Linux"

What do you think about this Article? Add your Opinion..!

Back To Top