Comment 563 for bug 88746

Revision history for this message
Hated On Mostly (mostly-hated-on) wrote :

Somebody posted what they think is the root of the problem. Maybe others can test it out and give feedback. Very interesting post. CFQ (Completely Fair Queuing) might be the culprit. Links in the post are at the bottom.

http://ubuntuforums.org/showpost.php?p=8124807&postcount=144

I finally found the source of the problem, at least as far as my setup goes. Here's how I did it:

I got frustrated with the Ubuntu/Mint slow transfer rates and decided to check out Fedora. I installed it and ran it for a week or so. Fedora has excellent file transfer speeds, both to and from USB devices and SATA partitions. I copied the kernel config from my Fedora install.

I loaded Mint back into my system and compared the kernel config there with the one I pulled from Fedora. After compileing a half dozen kernels, Kernel I/O Scheduling turned out to be the answer.

By default, since I don't know when, Ubuntu started using CFQ (Completely Fair Queuing) for it's Kernel I/O Scheduling default, but there are a few other options available. Anticipatory and Deadline are the two that seem to work best.

I recompiled a new kernel with the Anticipatory I/O Scheduling and, lo and behold, I had my old 30MB/s USB transfer speeds back, and SATA performance was improves two or three times. (Though it's still not as fast a I think an intra-partition transfer should be on a single SATA hard drive, 10 or 12 megs a second is a lot better than two or three.) There's a noticeable drop in system performance while transfers are taking place, but, at least for me, it wasn't half as bad as it was with CFQ enabled.

Take all that with a grain of salt, though, because I've found forum posts from as far back as 2006 that show people enabling CFQ for the exact same reasons we'll want to disable it here.

Due to some unrelated experiments I was running with Xorg and the catastrophic fail that is the current Intel Video driver setup, I borked my install beyond repair and had to re-do it. Further research into the solution showed me that you can select a default I/O Scheduler at boot up by passing an option on to the kernel.

I found that by appending the string elevator=as to the end of the kernel parameters in /boot/grub/menu.lst, you can enable anticipatory I/O scheduling. The strings elevator=deadline and elevator=noop can be used as well, though I'm not so sure about their effects.

-------------
title Linux Mint 7 Gloria, kernel 2.6.28-15-generic
root (hd0,7)
 kernel /vmlinuz-2.6.28-15-generic root=/dev/sda6 ro quiet splash elevator=as
initrd /initrd.img-2.6.28-15-generic
quiet
-------------

It is also possible to change the I/O scheduler for certain devices without making it a system default, as can be found in these two blog posts.

I'd be interested in seeing if any of you get similar results by trying these solutions.

http://ubuntuforums.org/showthread.php?t=119546
http://www.cyberciti.biz/faq/linux-change-io-scheduler-for-harddisk/
http://planet.admon.org/howto/how-to-change-default-io-scheduler/