IO Measurement
Installation of the tools
Debian/Ubuntu:
apt-get install fio ioping
Centos/RHEL:
yum install epel-release yum install fio ioping
Usage
ioping
ioping -c 20 . 4 KiB <<< . (xfs /dev/sda2): request=1 time=426.1 us (warmup) 4 KiB <<< . (xfs /dev/sda2): request=2 time=1.06 ms 4 KiB <<< . (xfs /dev/sda2): request=3 time=1.05 ms 4 KiB <<< . (xfs /dev/sda2): request=4 time=1.06 ms 4 KiB <<< . (xfs /dev/sda2): request=5 time=1.06 ms 4 KiB <<< . (xfs /dev/sda2): request=6 time=1.07 ms 4 KiB <<< . (xfs /dev/sda2): request=7 time=147.7 us (fast) 4 KiB <<< . (xfs /dev/sda2): request=8 time=1.08 ms (slow) 4 KiB <<< . (xfs /dev/sda2): request=9 time=1.08 ms (slow) 4 KiB <<< . (xfs /dev/sda2): request=10 time=1.10 ms (slow)
For more options see
man ioping
fio
R/W:
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75 fio-2.16 Starting 1 process test: Laying out IO file(s) (1 file(s) / 4096MB) Jobs: 1 (f=1): [m(1)] [97.4% done] [93264KB/31068KB/0KB /s] [23.4K/7767/0 iops] [eta 00m:01s] test: (groupid=0, jobs=1): err= 0: pid=20731: Thu Apr 4 11:37:35 2019 read : io=3070.4MB, bw=83364KB/s, iops=20840, runt= 37714msec write: io=1025.8MB, bw=27850KB/s, iops=6962, runt= 37714msec cpu : usr=2.71%, sys=8.06%, ctx=207268, majf=0, minf=7 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0% issued : total=r=785996/w=262580/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=64 Run status group 0 (all jobs): READ: io=3070.4MB, aggrb=83363KB/s, minb=83363KB/s, maxb=83363KB/s, mint=37714msec, maxt=37714msec WRITE: io=1025.8MB, aggrb=27849KB/s, minb=27849KB/s, maxb=27849KB/s, mint=37714msec, maxt=37714msec Disk stats (read/write): sda: ios=781939/261286, merge=0/1, ticks=1141589/30342, in_queue=1173273, util=99.93%
Random read:
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randread fio-2.16 Starting 1 process test: Laying out IO file(s) (1 file(s) / 4096MB) Jobs: 1 (f=1): [r(1)] [97.8% done] [113.1MB/0KB/0KB /s] [29.2K/0/0 iops] [eta 00m:01s] test: (groupid=0, jobs=1): err= 0: pid=20999: Thu Apr 4 11:41:20 2019 read : io=4096.0MB, bw=93818KB/s, iops=23454, runt= 44707msec cpu : usr=1.76%, sys=5.82%, ctx=202402, majf=0, minf=73 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0% issued : total=r=1048576/w=0/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=64 Run status group 0 (all jobs): READ: io=4096.0MB, aggrb=93817KB/s, minb=93817KB/s, maxb=93817KB/s, mint=44707msec, maxt=44707msec Disk stats (read/write): sda: ios=1046707/6, merge=0/1, ticks=1400096/8, in_queue=1401300, util=100.00%
For more options see
man fio
Don't forgot to delete test file (--name=test).