LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Linux Disk IO Scheduler (https://www.linuxquestions.org/questions/linux-general-1/linux-disk-io-scheduler-714255/)

aznium 03-25-2009 02:22 AM

Linux Disk IO Scheduler
 
suppose i have 10 IO tasks outstanding - each are reads and each space out evenly on the hard drive .... how does the kernel rotate between the IO tasks? how often does it switch from 1 IO to another?

syg00 03-25-2009 08:41 PM

That would be 10 I/O requests, not tasks. In simple terms, the I/Os are queued, in sector address order to minimise head thrashing. Normally if new I/Os come in they are inserted in order unless this causes some of the pending I/Os to get delayed too long in which case they will get preferential scheduling.
How all this is handled depends on the scheduler - as I said that's the 10,000 foot view.

H_TeXMeX_H 03-26-2009 11:10 AM

There are many different strategies:
http://en.wikipedia.org/wiki/I/O_scheduler

But, the only way to know which is best for you is to try it out. You can do so dynamically (while the system is running, in fact, right this very moment) by echoing the name into /sys/block/sda/queue/scheduler where sda is whatever block device you want...

Code:

bash-3.1$ cat /sys/block/sda/queue/scheduler
noop anticipatory [deadline] cfq
bash-3.1$ echo cfq > /sys/block/sda/queue/scheduler
bash-3.1$ cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]


sundialsvcs 03-27-2009 07:40 AM

The I/O scheduler determines the order in which physical requests are carried out, but there are also many buffers and caches that become involved ... on the hardware and the software level.

Under high and persistent I/O request loads, a difference in scheduler algorithms may become noticeable.


All times are GMT -5. The time now is 02:49 PM.