I am checking whether the linux file system i/o scheduler prioritizes the write operation over the read operation. The linux version is 3.10.0-327.el7.x86_64
I performed the following experiments where write and read operations should occur concurrently.
disk_dir=/mnt/ssd
nohup fio --name=${disk_dir}/seqread --ioengine=sync --iodepth=1 --rw=read --bs=4096k --direct=0 --size=10240M --numjobs=1 --runtime=600 --group_reporting &
nohup fio --name=${disk_dir}/seqwrite --ioengine=sync --iodepth=1 --rw=write --bs=4096k --direct=0 --size=10240M --numjobs=1 --runtime=600 --group_reporting &
I measured the disk I/O bandwidth usage by dstat and found that the read and write operations does not occur concurrently.
Disk
Read Write
... |3072k 241M| 13k 4211B| 0 0 |3737 2062
... |3072k 258M| 13k 4308B| 0 0 |3532 2676
... |3584k 260M| 16k 4793B| 0 0 |3404 2057
... |3072k 261M| 13k 4211B| 0 0 |3438 2565
...
... (After Write operations all finished)
...
... | 449M 40k| 13k 4211B| 0 0 |4752 5130
... | 449M 42k| 13k 4308B| 0 0 |4973 5861
... | 428M 0 | 16k 4793B| 0 0 |4630 4990
... | 382M 0 | 13k 4211B| 0 0 |4306 5206
Either Read or Write operation waits for another to be finished!
The results with the different schedulers in Linux were the same.
noop, deadline: They prioritize Write.
cfq: It prioritizes Read.
Am I missing something? Is the experiment itself wrong? Can any one give me an idea on it?
Thanks