一、功能需求
FIO工具在测试混合模型时读写IOPS默认是分开输出,给统计结果造成一定麻烦,如何实现像vdbench一样输出一列汇总IOPS。
默认输出如下所示:
[root@node01 fio-3.17]# fio -filename=/dev/sdc -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=libaio -bs=4k -size=1G -numjobs=1 -runtime=180 -group_reporting -name=randrw_70read_4k
randrw_70read_4k: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 fio-3.17Starting 1 thread Jobs: 1 (f=1): [m(1)][100.0%][r=568KiB/s,w=228KiB/s][r=142,w=57 IOPS][eta 00m:00s] randrw_70read_4k: (groupid=0, jobs=1): err= 0: pid=21828: Tue Jun 14 04:45:50 2022 read: IOPS=92, BW=370KiB/s (379kB/s)(65.1MiB/180005msec) slat (nsec): min=6075, max=98738, avg=13196.05, stdev=5899.85 clat (nsec): min=766, max=87866k, avg=4535074.61, stdev=4144048.55 lat (usec): min=17, max=87877, avg=4548.48, stdev=4144.28 clat percentiles (usec): | 1.00th=[ 12], 5.00th=[ 18], 10.00th=[ 23], 20.00th=[ 151], | 30.00th=[ 1942], 40.00th=[ 3097], 50.00th=[ 4228], 60.00th=[ 5407], | 70.00th=[ 6521], 80.00th=[ 7635], 90.00th=[ 8717], 95.00th=[ 9241], | 99.00th=[17171], 99.50th=[22676], 99.90th=[39584], 99.95th=[47449], | 99.99th=[85459] bw ( KiB/s): min= 16, max= 744, per=100.00%, avg=370.38, stdev=162.64, samples=360 iops : min= 4, max= 186, avg=92.58, stdev=40.66, samples=360 write: IOPS=39, BW=157KiB/s (161kB/s)(27.7MiB/180005msec) slat (usec): min=6, max=301507, avg=56.42, stdev=3582.12 clat (usec): min=1148, max=286545, avg=14642.58, stdev=21419.85 lat (usec): min=1166, max=359200, avg=14699.20, stdev=21801.69 clat percentiles (usec): | 1.00th=[ 1516], 5.00th=[ 1975], 10.00th=[ 2540], 20.00th=[ 3589], | 30.00th=[ 4621], 40.00th=[ 5669], 50.00th=[ 6652], 60.00th=[ 7767], | 70.00th=[ 8717], 80.00th=[ 9765], 90.00th=[ 57934], 95.00th=[ 63701], | 99.00th=[ 83362], 99.50th=[ 95945], 99.90th=[127402], 99.95th=[135267], | 99.99th=[287310] bw ( KiB/s): min= 16, max= 328, per=100.00%, avg=157.39, stdev=66.16, samples=360 iops : min= 4, max= 82, avg=39.33, stdev=16.53, samples=360 lat (nsec) : 1000=0.08% lat (usec) : 2=0.40%, 10=0.01%, 20=5.29%, 50=3.88%, 100=0.12% lat (usec) : 250=5.43%, 500=0.15%, 750=0.04%, 1000=0.47% lat (msec) : 2=7.16%, 4=17.66%, 10=50.68%, 20=3.63%, 50=0.75% lat (msec) : 100=4.15%, 250=0.10%, 500=0.01% cpu : usr=0.09%, sys=0.40%, ctx=23641, majf=0, minf=9 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=16670,7084,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=370KiB/s (379kB/s), 370KiB/s-370KiB/s (379kB/s-379kB/s), io=65.1MiB (68.3MB), run=180005-180005msec WRITE: bw=157KiB/s (161kB/s), 157KiB/s-157KiB/s (161kB/s-161kB/s), io=27.7MiB (29.0MB), run=180005-180005msec Disk stats (read/write): sdc: ios=16701/7080, merge=0/0, ticks=75498/103930, in_queue=179419, util=99.72% |
二、组网图
不涉及
三、配置步骤
在测试命令或者job文件中加参数-unified_rw_reporting=1,加参数以后输出结果如下:
[root@node01 fio-3.17]# fio -filename=/dev/sdc -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=lib aio -bs=4k -size=1G -numjobs=1 -runtime=180 -unified_rw_reporting=1 -group_reporting -name=randrw_70read_4k randrw_70read_4k: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=1 fio-3.17 Starting 1 thread Jobs: 1 (f=1): [m(1)][100.0%][r=816KiB/s][r=204 IOPS][eta 00m:00s] randrw_70read_4k: (groupid=0, jobs=1): err= 0: pid=21855: Tue Jun 14 04:59:03 2022 mixed: IOPS=184, BW=737KiB/s (754kB/s)(130MiB/180057msec) slat (nsec): min=6522, max=94623, avg=15368.73, stdev=7011.48 clat (nsec): min=1119, max=139026k, avg=5412864.93, stdev=3829953.71 lat (usec): min=26, max=139043, avg=5428.48, stdev=3830.14 clat percentiles (usec): | 1.00th=[ 127], 5.00th=[ 149], 10.00th=[ 1434], 20.00th=[ 2409], | 30.00th=[ 3326], 40.00th=[ 4293], 50.00th=[ 5211], 60.00th=[ 6128], | 70.00th=[ 7046], 80.00th=[ 7963], 90.00th=[ 8848], 95.00th=[ 9503], | 99.00th=[17695], 99.50th=[22152], 99.90th=[35390], 99.95th=[47449], | 99.99th=[81265] bw ( KiB/s): min= 200, max= 1064, per=100.00%, avg=736.67, stdev=56.19, samples=720 iops : min= 50, max= 266, avg=184.13, stdev=14.05, samples=720 lat (usec) : 2=0.01%, 20=0.03%, 50=0.01%, 100=0.06%, 250=6.03% lat (usec) : 500=0.14%, 750=0.05%, 1000=0.57% lat (msec) : 2=8.79%, 4=21.11%, 10=59.55%, 20=2.98%, 50=0.62% lat (msec) : 100=0.03%, 250=0.01% cpu : usr=0.10%, sys=0.40%, ctx=33153, majf=0, minf=9 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=33155,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): MIXED: bw=737KiB/s (754kB/s), 737KiB/s-737KiB/s (754kB/s-754kB/s), io=130MiB (136MB), run=180057-180057msec Disk stats (read/write): sdc: ios=23249/9925, merge=0/0, ticks=118251/60942, in_queue=179177, util=99.59% |
四、配置关键点
加参数 -unified _rw_reporting=1
六、关键字
fio,混合模型,unified_rw_reporting