IO-Scheduler

 

查看 Kernel 支援什麼 scheduler

cat  /sys/block/sda/queue/scheduler

noop [anticipatory] deadline cfq

kernel 一共支援 4 種 scheduler, 而現在在用  anticipatory


設定

echo deadline > /sys/block/sda/queue/scheduler

P.S.

Linux 2.6.32 default cfq

 


介紹

 

noop scheduler:

just service next request in the queue without any algorithm to prefer this or that request.

 

deadline scheduler: (database systems)

* guarantees a start service time for each I/O request.
* requests are given a deadline by which they get served.
* some realtime behaviour.
* Prioritizes read requests higher than write requests

Expiration time:
- read queues: 500 ms
- write queues: 5 sec

運作:

If the first request in the deadline queue expired
1 The Deadline I/O scheduler services the first request in the deadline queue immediately.(or sorts deadline queues by the expiration times)
2 services a batch of requests near the disk location of the request (sorts the other queues by the positions)

Complete Fair Queueing Scheduler (cfq):(multiuser system)

different sort of stab at fairness.

 

Anticipatory IO Scheduler (AS): (Apache web server)

  • anticipatory reads (pausing for a short time (a few milliseconds) after a read operation in anticipation of another close-by read requests.)
  • avoiding harddisk head movements if possible

anticipatory scheduler seems to be sub-optimal on high (eg [resync]) loads.