Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I run Debian Live as a persistent system on a 16 GB pen drive. This is my workhorse every day system. I was earlier plagued with continual delays and freezes due to slow write speeds. I have repartitioned the drive and aligned the partitions, resulting in what seems like a significant boost in speed, but I'm also wondering about whether changing the I/O scheduler would help.

There seem to be two candidates: deadline and noop. This page recommends deadline, and I just changed to that. It seems to have helped but the impression is purely subjective. However, the consensus on Stack Overflow seems to be that noop is best for flash devices (see here and here). But I'm not able to understand how a scheduler that does nothing - i.e. noop - can be more efficient.

Since I expect that I'd have to try out either for a week or so to see if it actually helps, I thought I'd ask if anyone has any idea which would be better.

share|improve this question

migrated from stackoverflow.com Jan 28 '13 at 7:47

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 5 down vote accepted

Flash devices should be better handled by a no-operation I/O scheduler. Although that's not a definitive answer. Keep reading.

A mechanical device (such as HDD) spends a lot of time in seeking operations, finding the right position on a disk plate to perform reading or writing. It does that by moving a mechanical head that has a limited speed. Although that speed seems quite high, flash devices don't require this, and are therefore faster by design.

The task of an I/O scheduler is mainly to group, reorder, and when possible, merge I/O operations. One of the main intents is to decrease the seeking penalty by lowering the amount of necessary seek operations.

That's why a NOOP scheduler is superior to most schedulers for flash devices. Having in mind there's no seek penalty incurred in any I/O operation, the scheduler does not need to do much. The less it does, the better. With very few CPU cycles required for each I/O operation, it's also very battery friendly.

On the other hand, DEADLINE may be a good fit if you are worried by I/O starvation, while your system is rarely going to be overloaded. The scheduler imposes a deadline to every I/O operation, which positively impacts on latency. It uses multiple queues to store operations and sorts them according to their deadline. By committing to these deadlines, it can guarantee no I/O starvation during normal CPU loads.

To conclude, there's no one size fits all. Every scheduler has its pros and cons. The best thing you can do IMHO is to read about Noop, Deadline, and SIO, and find which one fits better to your scenario. You could also test them for a period, and see how they react to your daily usage.

Ultimately, I did find a good forum post that seems accurate and covers the main advantages/disadvantages of each I/O scheduler.

share|improve this answer
    
Thanks for an excellent answer. SIO does not seem to be in the Debian Wheezy kernel, but not sure. I also felt that deadline would be better than noop because of the vast difference in read and write speeds on flash media (deadline prioritises reads over writes). However, at present, I seem to get widely varying performance with deadline. Meanwhile, someone else recommends the BFQ scheduler. –  ShankarG Jan 28 '13 at 11:08
add comment

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.