IO System

img(°0°)

IO Scheduler

img(°0°)

CFQ:CFQ works by placing synchronous requests submitted by processes into a number of per-process queues and then allocating timeslices for each of the queues to access the disk. The length of the time slice and the number of requests a queue is allowed to submit depends on the IO priority of the given process. Asynchronous requests for all processes are batched together in fewer queues, one per priority.

img(°0°)

DEADLINE:- The goal of the Deadline scheduler is to attempt to guarantee a start service time for a request. It does that by imposing a deadline on all I/O operations to prevent starvation of requests. It also maintains two deadline queues, in addition to the sorted queues (both read and write). Deadline queues are basically sorted by their deadline (the expiration time), while the sorted queues are sorted by the sector number.

img(°0°)

NOOP:- The NOOP scheduler inserts all incoming I/O requests into a simple, unordered FIFO queue and implements request merging.

IO Monitor

 - iostat -c -d -x -t -m /dev/sdaX 2
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.30    0.00    0.15    0.61    0.00   98.94

Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda4              0.00  1950.50    8.50 4362.50     0.07    99.24    46.53     3.82    0.87    0.41    0.88   0.04  16.95

%user: The percentage of CPU utilization that occurred while executing at the user level (this is the application usage).
%nice: The percentage of CPU utilization that occurred while executing at the user level with nice priority.
%system: The percentage of CPU utilization that occurred while executing at the system level (kernel).
%iowait: The percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
%steal: The percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
%idle: The percentage of time that the CPU or CPUs were idle and the systems did not have an outstanding disk I/O request.

Units	Definition
rrqm/s	The number of read requests merged per second queued to the device.(noop/deadline/cfg)
wrqm/s	The number of write requests merged per second queued to the device(noop/deadline/cfg).
r/s	The number of read requests issued to the device per second.
w/s	The number of write requests issued to the device per second.
rMB/s	The number of megabytes read from the device per second. (I chose to used MB/s for the output.)
wMB/s	The number of megabytes written to the device per second. (I chose to use MB/s for the output.)
avgrq-sz	The average size (in sectors) of the requests issued to the device. --size(sector*521(B)) of each request(big io or small io)
avgqu-sz	The average queue length of the requests issued to the device.---queue size of waiting io request
await	The average time (milliseconds) for I/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
r_await	The average time (in milliseconds) for read requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
w_await	The average time (in milliseconds) for write requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
svctm(Warning, should be removed)	The average service time (in milliseconds) for I/O requests issued to the device. Warning! Do not trust this field; it will be removed in a future version of sysstat.
%util	Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this values is close to 100%.
Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100% for devices serving requests serially. 
**But for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits.**

 - iotop