需要安装fio

yum install fio -y

有很多依赖包

 

 

FIO用法:

随机读:(可直接用,向磁盘写一个2G文件,10线程,随机读1分钟,给出结果)

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=16k -numjobs=10 -runtime=60 -group_reporting -name=mytest -size=2G

显示结果:

mytest: (g=0): rw=randread, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
...
fio-3.7
Starting 10 threads
mytest: Laying out IO file (1 file / 2048MiB)
Jobs: 10 (f=10): [r(10)][100.0%][r=126MiB/s,w=0KiB/s][r=8045,w=0 IOPS][eta 00m:00s]
mytest: (groupid=0, jobs=1): err= 0: pid=24182: Mon Jul 13 15:57:05 2020
read: IOPS=824, BW=12.9MiB/s (13.5MB/s)(773MiB/60046msec)
clat (usec): min=201, max=46687, avg=1208.29, stdev=1106.39
lat (usec): min=201, max=46691, avg=1208.64, stdev=1106.52
clat percentiles (usec):
| 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 709],
| 30.00th=[ 816], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
| 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1860], 95.00th=[ 2409],
| 99.00th=[ 4490], 99.50th=[ 6194], 99.90th=[13304], 99.95th=[19268],
| 99.99th=[42730]
bw ( KiB/s): min=10187, max=14368, per=10.06%, avg=13202.06, stdev=740.90, samples=119
iops : min= 636, max= 898, avg=825.11, stdev=46.33, samples=119
lat (usec) : 250=0.12%, 500=6.43%, 750=17.22%, 1000=24.66%
lat (msec) : 2=43.50%, 4=6.76%, 10=1.10%, 20=0.17%, 50=0.04%
cpu : usr=0.37%, sys=9.47%, ctx=49126, majf=0, minf=4
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49503,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24183: Mon Jul 13 15:57:05 2020
read: IOPS=822, BW=12.9MiB/s (13.5MB/s)(772MiB/60001msec)
clat (usec): min=193, max=54554, avg=1210.28, stdev=1134.88
lat (usec): min=193, max=54555, avg=1210.66, stdev=1135.24
clat percentiles (usec):
| 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 701],
| 30.00th=[ 816], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
| 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
| 99.00th=[ 4490], 99.50th=[ 6456], 99.90th=[15795], 99.95th=[20579],
| 99.99th=[36963]
bw ( KiB/s): min= 9472, max=14592, per=10.03%, avg=13169.25, stdev=801.80, samples=119
iops : min= 592, max= 912, avg=823.01, stdev=50.12, samples=119
lat (usec) : 250=0.14%, 500=6.37%, 750=17.55%, 1000=24.72%
lat (msec) : 2=42.94%, 4=7.02%, 10=1.03%, 20=0.19%, 50=0.05%
lat (msec) : 100=0.01%
cpu : usr=0.41%, sys=9.43%, ctx=48992, majf=0, minf=4
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49380,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24184: Mon Jul 13 15:57:05 2020
read: IOPS=825, BW=12.9MiB/s (13.5MB/s)(774MiB/60001msec)
clat (usec): min=195, max=72242, avg=1206.03, stdev=1143.48
lat (usec): min=195, max=72242, avg=1206.40, stdev=1143.62
clat percentiles (usec):
| 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 701],
| 30.00th=[ 807], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
| 70.00th=[ 1270], 80.00th=[ 1467], 90.00th=[ 1860], 95.00th=[ 2376],
| 99.00th=[ 4490], 99.50th=[ 6652], 99.90th=[14746], 99.95th=[18220],
| 99.99th=[39584]
bw ( KiB/s): min= 9701, max=14368, per=10.07%, avg=13211.33, stdev=803.55, samples=120
iops : min= 606, max= 898, avg=825.67, stdev=50.24, samples=120
lat (usec) : 250=0.13%, 500=6.57%, 750=17.56%, 1000=24.54%
lat (msec) : 2=43.13%, 4=6.77%, 10=1.08%, 20=0.20%, 50=0.04%
lat (msec) : 100=0.01%
cpu : usr=0.36%, sys=9.48%, ctx=49221, majf=0, minf=5
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49558,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24185: Mon Jul 13 15:57:05 2020
read: IOPS=822, BW=12.9MiB/s (13.5MB/s)(771MiB/60001msec)
clat (usec): min=205, max=45488, avg=1209.12, stdev=1078.62
lat (usec): min=205, max=45488, avg=1209.48, stdev=1078.74
clat percentiles (usec):
| 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 709],
| 30.00th=[ 816], 40.00th=[ 914], 50.00th=[ 1012], 60.00th=[ 1123],
| 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
| 99.00th=[ 4490], 99.50th=[ 6325], 99.90th=[14484], 99.95th=[19268],
| 99.99th=[34341]
bw ( KiB/s): min=10048, max=14496, per=10.03%, avg=13168.22, stdev=870.68, samples=119
iops : min= 628, max= 906, avg=822.97, stdev=54.45, samples=119
lat (usec) : 250=0.16%, 500=6.44%, 750=17.21%, 1000=24.70%
lat (msec) : 2=43.22%, 4=6.97%, 10=1.08%, 20=0.17%, 50=0.05%
cpu : usr=0.36%, sys=9.48%, ctx=48957, majf=0, minf=8
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49368,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24186: Mon Jul 13 15:57:05 2020
read: IOPS=818, BW=12.8MiB/s (13.4MB/s)(767MiB/60001msec)
clat (usec): min=195, max=111604, avg=1216.88, stdev=1179.19
lat (usec): min=195, max=111604, avg=1217.29, stdev=1180.56
clat percentiles (usec):
| 1.00th=[ 330], 5.00th=[ 461], 10.00th=[ 570], 20.00th=[ 709],
| 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
| 70.00th=[ 1287], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
| 99.00th=[ 4621], 99.50th=[ 6652], 99.90th=[13829], 99.95th=[18220],
| 99.99th=[36963]
bw ( KiB/s): min= 8637, max=14115, per=9.98%, avg=13099.41, stdev=767.93, samples=119
iops : min= 539, max= 882, avg=818.66, stdev=48.03, samples=119
lat (usec) : 250=0.10%, 500=6.46%, 750=16.93%, 1000=24.45%
lat (msec) : 2=43.82%, 4=6.82%, 10=1.18%, 20=0.20%, 50=0.03%
lat (msec) : 250=0.01%
cpu : usr=0.40%, sys=9.45%, ctx=48738, majf=0, minf=4
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49111,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24187: Mon Jul 13 15:57:05 2020
read: IOPS=822, BW=12.8MiB/s (13.5MB/s)(771MiB/60001msec)
clat (usec): min=187, max=57617, avg=1211.33, stdev=1096.79
lat (usec): min=187, max=57618, avg=1211.67, stdev=1096.91
clat percentiles (usec):
| 1.00th=[ 330], 5.00th=[ 465], 10.00th=[ 570], 20.00th=[ 709],
| 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
| 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2376],
| 99.00th=[ 4424], 99.50th=[ 6194], 99.90th=[14353], 99.95th=[18744],
| 99.99th=[40109]
bw ( KiB/s): min= 9952, max=14432, per=10.03%, avg=13163.26, stdev=847.60, samples=119
iops : min= 622, max= 902, avg=822.66, stdev=52.98, samples=119
lat (usec) : 250=0.13%, 500=6.30%, 750=17.08%, 1000=24.41%
lat (msec) : 2=43.95%, 4=6.82%, 10=1.10%, 20=0.18%, 50=0.04%
lat (msec) : 100=0.01%
cpu : usr=0.36%, sys=9.48%, ctx=48971, majf=0, minf=5
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49340,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24188: Mon Jul 13 15:57:05 2020
read: IOPS=816, BW=12.8MiB/s (13.4MB/s)(766MiB/60001msec)
clat (usec): min=193, max=47040, avg=1219.79, stdev=1099.57
lat (usec): min=193, max=47040, avg=1220.16, stdev=1099.84
clat percentiles (usec):
| 1.00th=[ 330], 5.00th=[ 465], 10.00th=[ 570], 20.00th=[ 709],
| 30.00th=[ 824], 40.00th=[ 922], 50.00th=[ 1029], 60.00th=[ 1139],
| 70.00th=[ 1287], 80.00th=[ 1500], 90.00th=[ 1893], 95.00th=[ 2409],
| 99.00th=[ 4621], 99.50th=[ 6521], 99.90th=[15008], 99.95th=[18744],
| 99.99th=[34341]
bw ( KiB/s): min=10560, max=14432, per=9.95%, avg=13065.61, stdev=742.12, samples=119
iops : min= 660, max= 902, avg=816.55, stdev=46.42, samples=119
lat (usec) : 250=0.12%, 500=6.34%, 750=16.98%, 1000=23.95%
lat (msec) : 2=44.20%, 4=7.03%, 10=1.16%, 20=0.19%, 50=0.04%
cpu : usr=0.41%, sys=9.43%, ctx=48593, majf=0, minf=4
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=48996,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24189: Mon Jul 13 15:57:05 2020
read: IOPS=812, BW=12.7MiB/s (13.3MB/s)(762MiB/60001msec)
clat (usec): min=209, max=65934, avg=1225.17, stdev=1171.39
lat (usec): min=209, max=65935, avg=1225.52, stdev=1171.51
clat percentiles (usec):
| 1.00th=[ 334], 5.00th=[ 465], 10.00th=[ 578], 20.00th=[ 717],
| 30.00th=[ 824], 40.00th=[ 922], 50.00th=[ 1029], 60.00th=[ 1139],
| 70.00th=[ 1287], 80.00th=[ 1500], 90.00th=[ 1876], 95.00th=[ 2409],
| 99.00th=[ 4621], 99.50th=[ 6456], 99.90th=[16909], 99.95th=[20579],
| 99.99th=[35390]
bw ( KiB/s): min= 9152, max=14464, per=9.91%, avg=13010.76, stdev=896.78, samples=119
iops : min= 572, max= 904, avg=813.13, stdev=56.06, samples=119
lat (usec) : 250=0.11%, 500=6.26%, 750=16.66%, 1000=24.56%
lat (msec) : 2=44.10%, 4=6.90%, 10=1.16%, 20=0.19%, 50=0.06%
lat (msec) : 100=0.01%
cpu : usr=0.38%, sys=9.46%, ctx=48401, majf=0, minf=0
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=48777,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24190: Mon Jul 13 15:57:05 2020
read: IOPS=822, BW=12.9MiB/s (13.5MB/s)(771MiB/60000msec)
clat (usec): min=189, max=56124, avg=1210.99, stdev=1097.65
lat (usec): min=189, max=56124, avg=1211.36, stdev=1097.82
clat percentiles (usec):
| 1.00th=[ 338], 5.00th=[ 469], 10.00th=[ 578], 20.00th=[ 709],
| 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
| 70.00th=[ 1270], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
| 99.00th=[ 4424], 99.50th=[ 6128], 99.90th=[14091], 99.95th=[17957],
| 99.99th=[38011]
bw ( KiB/s): min= 9856, max=14368, per=10.02%, avg=13158.12, stdev=712.98, samples=119
iops : min= 616, max= 898, avg=822.32, stdev=44.57, samples=119
lat (usec) : 250=0.11%, 500=6.16%, 750=17.34%, 1000=24.42%
lat (msec) : 2=43.71%, 4=6.94%, 10=1.11%, 20=0.17%, 50=0.03%
lat (msec) : 100=0.01%
cpu : usr=0.42%, sys=9.42%, ctx=48989, majf=0, minf=4
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49347,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1
mytest: (groupid=0, jobs=1): err= 0: pid=24191: Mon Jul 13 15:57:05 2020
read: IOPS=819, BW=12.8MiB/s (13.4MB/s)(769MiB/60023msec)
clat (usec): min=201, max=45774, avg=1214.86, stdev=1085.41
lat (usec): min=201, max=45775, avg=1215.21, stdev=1085.53
clat percentiles (usec):
| 1.00th=[ 338], 5.00th=[ 465], 10.00th=[ 570], 20.00th=[ 709],
| 30.00th=[ 816], 40.00th=[ 922], 50.00th=[ 1020], 60.00th=[ 1139],
| 70.00th=[ 1287], 80.00th=[ 1483], 90.00th=[ 1876], 95.00th=[ 2409],
| 99.00th=[ 4621], 99.50th=[ 6587], 99.90th=[13960], 99.95th=[18220],
| 99.99th=[32900]
bw ( KiB/s): min=10624, max=14592, per=10.00%, avg=13128.82, stdev=717.79, samples=119
iops : min= 664, max= 912, avg=820.50, stdev=44.88, samples=119
lat (usec) : 250=0.14%, 500=6.34%, 750=17.37%, 1000=24.06%
lat (msec) : 2=43.91%, 4=6.78%, 10=1.19%, 20=0.18%, 50=0.03%
cpu : usr=0.37%, sys=9.46%, ctx=48840, majf=0, minf=4
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=49210,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs):
READ: bw=128MiB/s (134MB/s), 12.7MiB/s-12.9MiB/s (13.3MB/s-13.5MB/s), io=7697MiB (8071MB), run=60000-60046msec Disk stats (read/write):
dm-2: ios=492162/9, merge=0/0, ticks=154072/0, in_queue=154081, util=99.44%, aggrios=492602/12, aggrmerge=0/3, aggrticks=153537/0, aggrin_queue=153117, aggrutil=99.32%
sda: ios=492602/12, merge=0/3, ticks=153537/0, in_queue=153117, util=99.32%

说明:

filename=/home/data 测试文件名称,通常选择需要测试的盘的data目录。和dd命令中的of输出文件类似

direct=1 测试过程绕过机器自带的buffer。使测试结果更真实。

rw=randwrite 测试随机写的I/O

rw=randrw 测试随机写和读的I/O

bs=16k 单次io的块文件大小为16k

bsrange=512-2048 同上,提定数据块的大小范围

size=5g 本次的测试文件大小为5g,以每次4k的io进行测试。

numjobs=30 本次的测试线程为30.

runtime=1000 测试时间为1000秒,如果不写则一直将5g文件分4k每次写完为止。

ioengine=psync io引擎使用pync方式

rwmixwrite=30 在混合读写的模式下,写占30%

group_reporting 关于显示结果的,汇总每个进程的信息。

此外

lockmem=1g 只使用1g内存进行测试。

zero_buffers 用0初始化系统buffer。

nrfiles=8 每个进程生成文件的数量。

read 顺序读

write 顺序写

rw,readwrite 顺序混合读写

randwrite 随机写

randread 随机读

randrw 随机混合读写

io总的输入输出量

bw:带宽 KB/s

iops:每秒钟的IO数

runt:总运行时间

lat (msec):延迟(毫秒)

msec: 毫秒

usec: 微秒

顺序读:

fio -filename=/home/data-direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G

[root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G
mytest: (g=0): rw=read, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
...
fio-3.7
Starting 2 threads
Jobs: 1 (f=1): [_(1),R(1)][100.0%][r=94.7MiB/s,w=0KiB/s][r=6058,w=0 IOPS][eta 00m:00s]
mytest: (groupid=0, jobs=2): err= 0: pid=24221: Mon Jul 13 16:08:41 2020
read: IOPS=6576, BW=103MiB/s (108MB/s)(2048MiB/19929msec)
clat (usec): min=129, max=46795, avg=297.05, stdev=329.58
lat (usec): min=129, max=46795, avg=297.38, stdev=332.03
clat percentiles (usec):
| 1.00th=[ 151], 5.00th=[ 167], 10.00th=[ 184], 20.00th=[ 225],
| 30.00th=[ 241], 40.00th=[ 253], 50.00th=[ 265], 60.00th=[ 277],
| 70.00th=[ 293], 80.00th=[ 318], 90.00th=[ 363], 95.00th=[ 441],
| 99.00th=[ 1106], 99.50th=[ 1696], 99.90th=[ 3490], 99.95th=[ 4948],
| 99.99th=[11600]
bw ( KiB/s): min=32447, max=66720, per=50.43%, avg=53065.45, stdev=6970.87, samples=77
iops : min= 2027, max= 4170, avg=3316.53, stdev=435.75, samples=77
lat (usec) : 250=37.02%, 500=59.44%, 750=1.87%, 1000=0.51%
lat (msec) : 2=0.78%, 4=0.31%, 10=0.06%, 20=0.01%, 50=0.01%
cpu : usr=0.40%, sys=28.06%, ctx=130128, majf=0, minf=17
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=131072,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs):
READ: bw=103MiB/s (108MB/s), 103MiB/s-103MiB/s (108MB/s-108MB/s), io=2048MiB (2147MB), run=19929-19929msec Disk stats (read/write):
dm-2: ios=130899/0, merge=0/0, ticks=31550/0, in_queue=31551, util=93.69%, aggrios=131072/0, aggrmerge=0/0, aggrticks=31572/0, aggrin_queue=31551, aggrutil=93.55%
sda: ios=131072/0, merge=0/0, ticks=31572/0, in_queue=31551, util=93.55%

随机写:

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G

[root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G
mytest: (g=0): rw=randwrite, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
...
fio-3.7
Starting 2 threads
Jobs: 2 (f=2): [w(2)][100.0%][r=0KiB/s,w=117MiB/s][r=0,w=7516 IOPS][eta 00m:00s]
mytest: (groupid=0, jobs=2): err= 0: pid=24226: Mon Jul 13 16:09:40 2020
write: IOPS=7061, BW=110MiB/s (116MB/s)(2048MiB/18562msec)
clat (usec): min=140, max=23792, avg=278.42, stdev=262.60
lat (usec): min=140, max=23792, avg=279.05, stdev=262.83
clat percentiles (usec):
| 1.00th=[ 167], 5.00th=[ 182], 10.00th=[ 194], 20.00th=[ 208],
| 30.00th=[ 221], 40.00th=[ 233], 50.00th=[ 243], 60.00th=[ 255],
| 70.00th=[ 273], 80.00th=[ 293], 90.00th=[ 347], 95.00th=[ 429],
| 99.00th=[ 963], 99.50th=[ 1516], 99.90th=[ 3228], 99.95th=[ 4015],
| 99.99th=[ 9765]
bw ( KiB/s): min=29472, max=61376, per=50.00%, avg=56485.92, stdev=5261.11, samples=74
iops : min= 1842, max= 3836, avg=3530.28, stdev=328.78, samples=74
lat (usec) : 250=56.30%, 500=40.49%, 750=1.75%, 1000=0.50%
lat (msec) : 2=0.64%, 4=0.26%, 10=0.04%, 20=0.01%, 50=0.01%
cpu : usr=1.58%, sys=45.69%, ctx=126798, majf=0, minf=7
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=0,131072,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs):
WRITE: bw=110MiB/s (116MB/s), 110MiB/s-110MiB/s (116MB/s-116MB/s), io=2048MiB (2147MB), run=18562-18562msec Disk stats (read/write):
dm-2: ios=0/129877, merge=0/0, ticks=0/31041, in_queue=31042, util=98.30%, aggrios=0/131072, aggrmerge=0/0, aggrticks=0/31051, aggrin_queue=30927, aggrutil=98.24%
sda: ios=0/131072, merge=0/0, ticks=0/31051, in_queue=30927, util=98.24%

顺序写:

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -size=1G

[root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest?-size=1G
mytest?-size=1G: (g=0): rw=write, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
...
fio-3.7
Starting 2 threads
Jobs: 2 (f=2): [W(2)][100.0%][r=0KiB/s,w=121MiB/s][r=0,w=7761 IOPS][eta 00m:00s]
mytest?-size=1G: (groupid=0, jobs=2): err= 0: pid=24258: Mon Jul 13 16:11:14 2020
write: IOPS=7372, BW=115MiB/s (121MB/s)(4096MiB/35556msec)
clat (usec): min=129, max=48018, avg=266.59, stdev=277.34
lat (usec): min=130, max=48019, avg=267.94, stdev=277.54
clat percentiles (usec):
| 1.00th=[ 163], 5.00th=[ 176], 10.00th=[ 188], 20.00th=[ 202],
| 30.00th=[ 215], 40.00th=[ 227], 50.00th=[ 237], 60.00th=[ 247],
| 70.00th=[ 265], 80.00th=[ 285], 90.00th=[ 330], 95.00th=[ 396],
| 99.00th=[ 840], 99.50th=[ 1336], 99.90th=[ 3163], 99.95th=[ 3884],
| 99.99th=[ 8094]
bw ( KiB/s): min=44608, max=64512, per=49.98%, avg=58957.11, stdev=4302.08, samples=141
iops : min= 2788, max= 4032, avg=3684.77, stdev=268.93, samples=141
lat (usec) : 250=61.91%, 500=35.58%, 750=1.33%, 1000=0.40%
lat (msec) : 2=0.55%, 4=0.19%, 10=0.04%, 20=0.01%, 50=0.01%
cpu : usr=1.55%, sys=45.64%, ctx=254608, majf=0, minf=7
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=0,262144,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs):
WRITE: bw=115MiB/s (121MB/s), 115MiB/s-115MiB/s (121MB/s-121MB/s), io=4096MiB (4295MB), run=35556-35556msec Disk stats (read/write):
dm-2: ios=0/261005, merge=0/0, ticks=0/60176, in_queue=60183, util=98.71%, aggrios=0/262164, aggrmerge=0/1, aggrticks=0/59821, aggrin_queue=59487, aggrutil=98.66%
sda: ios=0/262164, merge=0/1, ticks=0/59821, in_queue=59487, util=98.66%

混合随机读写:

fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -ioscheduler=noop -size=1G

[root@mysql-slave home]# fio -filename=/home/data -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -numjobs=2 -runtime=60 -group_reporting -name=mytest -ioscheduler=noop?-size=1G
mytest: (g=0): rw=randrw, bs=(R) 16.0KiB-16.0KiB, (W) 16.0KiB-16.0KiB, (T) 16.0KiB-16.0KiB, ioengine=psync, iodepth=1
...
fio-3.7
Starting 2 threads
fio: io scheduler is not tunable
fio: io scheduler is not tunable
Jobs: 1 (f=1): [_(1),m(1)][100.0%][r=34.1MiB/s,w=15.0MiB/s][r=2182,w=960 IOPS][eta 00m:00s]
mytest: (groupid=0, jobs=2): err= 0: pid=24285: Mon Jul 13 16:12:28 2020
read: IOPS=4060, BW=63.4MiB/s (66.5MB/s)(2867MiB/45191msec)
clat (usec): min=164, max=28045, avg=374.30, stdev=361.74
lat (usec): min=164, max=28045, avg=374.52, stdev=361.76
clat percentiles (usec):
| 1.00th=[ 221], 5.00th=[ 235], 10.00th=[ 245], 20.00th=[ 260],
| 30.00th=[ 273], 40.00th=[ 281], 50.00th=[ 293], 60.00th=[ 306],
| 70.00th=[ 326], 80.00th=[ 359], 90.00th=[ 433], 95.00th=[ 611],
| 99.00th=[ 2311], 99.50th=[ 2507], 99.90th=[ 3195], 99.95th=[ 3556],
| 99.99th=[ 5473]
bw ( KiB/s): min=23744, max=36896, per=50.56%, avg=32845.08, stdev=2406.20, samples=178
iops : min= 1484, max= 2306, avg=2052.70, stdev=150.43, samples=178
write: IOPS=1740, BW=27.2MiB/s (28.5MB/s)(1229MiB/45191msec)
clat (usec): min=135, max=5166, avg=252.94, stdev=164.78
lat (usec): min=135, max=5167, avg=253.68, stdev=164.86
clat percentiles (usec):
| 1.00th=[ 155], 5.00th=[ 165], 10.00th=[ 176], 20.00th=[ 188],
| 30.00th=[ 202], 40.00th=[ 217], 50.00th=[ 231], 60.00th=[ 245],
| 70.00th=[ 262], 80.00th=[ 277], 90.00th=[ 310], 95.00th=[ 359],
| 99.00th=[ 775], 99.50th=[ 1450], 99.90th=[ 2409], 99.95th=[ 3032],
| 99.99th=[ 3654]
bw ( KiB/s): min=10347, max=16320, per=50.57%, avg=14079.40, stdev=1082.83, samples=178
iops : min= 646, max= 1020, avg=879.91, stdev=67.75, samples=178
lat (usec) : 250=27.82%, 500=66.80%, 750=2.12%, 1000=0.50%
lat (msec) : 2=1.31%, 4=1.43%, 10=0.02%, 20=0.01%, 50=0.01%
cpu : usr=0.36%, sys=26.62%, ctx=260834, majf=0, minf=7
IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.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.0%, >=64=0.0%
issued rwts: total=183498,78646,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs):
READ: bw=63.4MiB/s (66.5MB/s), 63.4MiB/s-63.4MiB/s (66.5MB/s-66.5MB/s), io=2867MiB (3006MB), run=45191-45191msec
WRITE: bw=27.2MiB/s (28.5MB/s), 27.2MiB/s-27.2MiB/s (28.5MB/s-28.5MB/s), io=1229MiB (1289MB), run=45191-45191msec Disk stats (read/write):
dm-2: ios=183412/78606, merge=0/0, ticks=62288/16692, in_queue=78981, util=97.46%, aggrios=183504/78655, aggrmerge=0/0, aggrticks=62260/16671, aggrin_queue=78887, aggrutil=97.39%
sda: ios=183504/78655, merge=0/0, ticks=62260/16671, in_queue=78887, util=97.39%

最新文章

  1. Jquery EeasyUI等框架中图标的处理方法
  2. Java连接MySQL数据库——含步骤和代码
  3. freebsd|odoo - 为odoo报表 安装文泉译中文字体
  4. getattr的作用是什么呢
  5. linux设备驱动归纳总结(六):2.分享中断号【转】
  6. Spring AOP执行方法
  7. Linux Kernel 4.8分支第4个候选版本发布
  8. 向PHP语言进发
  9. CentOS Linux 语言环境设置
  10. linux 显示文件或文件夹
  11. redis性能调优笔记(can not get Resource from jedis pool和jedis connect time out)
  12. java乱码详解(java中byte与char的转换)
  13. Mac anaconda安装 “conda command not found” 解决方法
  14. SQL UNIQUE 约束
  15. 在SAS数据步中执行过程步的简单示例
  16. Day08 (黑客成长日记) 命名空间和作用域
  17. [TPYBoard - Micropython之会python就能做硬件 1] 运行第一个脚本——点亮LED
  18. 【设计经验】1、Verilog中如何规范的处理inout信号
  19. java 代码获取视频时长
  20. PyQt5--CustomizeSignal

热门文章

  1. STL—— 容器(vector)元素的删除
  2. Spring中毒太深,离开Spring我居然连最基本的接口都不会写了
  3. Mybatis(一)--简介
  4. 其它语言通过HiveServer2访问Hive
  5. Python高级语法-私有属性-名字重整(4.7.1)
  6. 【剑指offer】04 重建二叉树
  7. MySQL中函数总结
  8. windows Server 2016安装Sqlserver远程连接的坑
  9. 死磕以太坊源码分析之txpool
  10. [leetcode]304Range Sum Query 2D - Immutable动态规划计算二维数组中子数组的sum