As I mentioned in my Ubuntu 14.10 review, I was disappointed with the operating system’s responsiveness, for which, I later blamed the ‘deadline’ I/O scheduler. Luckily I was able to fix it by simply switching over to ‘CFQ’, the default disk I/O governor of Linux, so I thought writing a ‘how to’ would come in handy for the new users.
Changing the disk I/O scheduler in GNU/Linux is easy. You just have to add an option to GRUB’s (the boot-loader) main configuration file. You can do this by using the command-line only, or you can use a text editor GUI with a little help from the command-line. Here I will present the command-line method.
Command-line Way…
Step 1: Open a terminal window and enter the below command.
sudo nano /etc/default/grub
This will open a GRUB’s configuration files in ‘nano’ (simple & easy to use, command-line based text editor). Now look for the below line of text:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Step 2: Now simply add the below option at the end of quiet splash, with a space, but before the quotation mark (shown in the below screenshot).
elevator=cfq
Once done, press the ‘Ctrl’ + ‘x’ keys and when asked, type ‘y’ & press enter to exit saving the changes. We are almost done, all that is left is to let GRUB know that we have updated its configurations. For that, enter the below command.
sudo update-grub
That’s it. Now reboot your computer and from the next time on, the OS will be using the ‘CFQ’ I/O scheduler, which you can confirm by running the below command (depending on your primary storage media, you might have to change the ‘sda’ option though).
cat /sys/block/sda/queue/scheduler
Deadline scheduler still better than CFQ, http://www.phoronix.com/scan.php?page=article&item=linux_316_iosched&num=2
Thank you for the input. However, ‘Deadline’ is known to perform better under SSDs. For rotating disk drives, in my limited practical experience, even though ‘Deadline’ used to perform better in the past, these days, I prefer ‘CFQ’, it just seems to be more fair and responsive. But if it changes in the future, then yes I’ll switch back to ‘Deadline’…
Yes switching over to โCFQโ in gateway zx4951 all in one desktop pc ubuntu 14.10 solved the slowness issue Thanks Gayan
You’re welcome ๐ .
Hey, Gayan. What’s up?
Please, I’d like to know if this “how to” of yours is still valid and worth it on Ubuntu 15.04. Is it? By the way, I use Xubuntu 15.04, but I assume this trick fits any Ubuntu flavor, right?
Thanks for your time. Cheers. ๐
Bruno
Hi Bruno,
Yes, it’s still valid in Ubuntu 15.04 (http://www.hecticgeek.com/2015/04/ubuntu-15-04-review/), and if you’re having the same issue in any other Ubuntu you can try this trick, but please remember that it can also somewhat depend on the desktop environment as well (it’s a little complicated).
Cool, Gayan. Thanks for your reply. Well, I hope the trick is useful for Xubuntu as well because I’ve applied it here.
Thanks a lot. Cheers. ๐
Bruno
You’re welcome Bruno ๐ .
thanks Gayan this was very useful to me
You’re welcome.