fio --filename=/dev/sdb --rw=randread --bs=4k --iodepth=1 --numjobs=1 --runtime=60 --direct=1 --name=baseline --lat_percentiles=1 --group_reporting --output=sdb_randread_4k.log。结果如下: cat sdb_randread_4k.log
baseline: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.21
Starting 1 process
baseline: (groupid=0, jobs=1): err= 0: pid=171738: Tue Oct 7 10:28:25 2025
read: IOPS=85, BW=340KiB/s (348kB/s)(19.9MiB/60004msec)
clat (usec): min=1659, max=278502, avg=11752.50, stdev=5293.70
lat (usec): min=1659, max=278503, avg=11752.68, stdev=5293.71
clat percentiles (msec):
| 1.00th=[ 4], 5.00th=[ 6], 10.00th=[ 7], 20.00th=[ 9],
| 30.00th=[ 10], 40.00th=[ 11], 50.00th=[ 12], 60.00th=[ 13],
| 70.00th=[ 14], 80.00th=[ 15], 90.00th=[ 17], 95.00th=[ 18],
| 99.00th=[ 20], 99.50th=[ 21], 99.90th=[ 25], 99.95th=[ 48],
| 99.99th=[ 279]
lat percentiles (msec):
| 1.00th=[ 4], 5.00th=[ 6], 10.00th=[ 7], 20.00th=[ 9],
| 30.00th=[ 10], 40.00th=[ 11], 50.00th=[ 12], 60.00th=[ 13],
| 70.00th=[ 14], 80.00th=[ 15], 90.00th=[ 17], 95.00th=[ 18],
| 99.00th=[ 20], 99.50th=[ 21], 99.90th=[ 25], 99.95th=[ 48],
| 99.99th=[ 279]
bw ( KiB/s): min= 144, max= 392, per=100.00%, avg=340.57, stdev=24.83, samples=119
iops : min= 36, max= 98, avg=85.14, stdev= 6.21, samples=119
lat (msec) : 2=0.04%, 4=1.70%, 10=31.05%, 20=66.46%, 50=0.71%
lat (msec) : 100=0.02%, 500=0.02%
cpu : usr=0.04%, sys=0.03%, ctx=5104, majf=0, minf=14
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=5104,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=340KiB/s (348kB/s), 340KiB/s-340KiB/s (348kB/s-348kB/s), io=19.9MiB (20.9MB), run=60004-60004msec
Disk stats (read/write):
sdb: ios=5107/4, merge=0/0, ticks=60496/58, in_queue=58006, util=99.88%,缓存监控如下。
[root@localhost log]# hdparm -Tt /dev/sdb
/dev/sdb:
Timing cached reads: 16860 MB in 2.00 seconds = 8444.98 MB/sec
Timing buffered disk reads: 704 MB in 3.01 seconds = 234.22 MB/sec
优化fio --filename=/dev/sdb --rw=randread --bs=4k --iodepth=32 --numjobs=4 --runtime=300 --direct=1 --ioengine=libaio --group_reporting --name=optimized --output=1_sdb_randread_4k.log测试结果如下:[root@localhost log]# cat 1_sdb_randread_4k.log
optimized: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=32
...
fio-3.21
Starting 4 processes
optimized: (groupid=0, jobs=4): err= 0: pid=172156: Tue Oct 7 10:37:09 2025
read: IOPS=238, BW=955KiB/s (978kB/s)(280MiB/300637msec)
slat (nsec): min=3300, max=99300, avg=4822.21, stdev=1275.94
clat (msec): min=7, max=1995, avg=535.95, stdev=341.22
lat (msec): min=7, max=1995, avg=535.96, stdev=341.22
clat percentiles (msec):
| 1.00th=[ 42], 5.00th=[ 90], 10.00th=[ 134], 20.00th=[ 213],
| 30.00th=[ 296], 40.00th=[ 380], 50.00th=[ 472], 60.00th=[ 575],
| 70.00th=[ 709], 80.00th=[ 860], 90.00th=[ 1036], 95.00th=[ 1167],
| 99.00th=[ 1368], 99.50th=[ 1452], 99.90th=[ 1620], 99.95th=[ 1670],
| 99.99th=[ 1787]
bw ( KiB/s): min= 272, max= 1376, per=100.00%, avg=955.43, stdev=34.48, samples=2400
iops : min= 68, max= 344, avg=238.86, stdev= 8.62, samples=2400
lat (msec) : 10=0.01%, 20=0.12%, 50=1.38%, 100=4.57%, 250=18.61%
lat (msec) : 500=28.07%, 750=20.01%, 1000=15.41%, 2000=11.82%
cpu : usr=0.02%, sys=0.04%, ctx=71782, majf=0, minf=177
IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=99.8%, >=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.1%, 64=0.0%, >=64=0.0%
issued rwts: total=71781,0,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=32
Run status group 0 (all jobs):
READ: bw=955KiB/s (978kB/s), 955KiB/s-955KiB/s (978kB/s-978kB/s), io=280MiB (294MB), run=300637-300637msec
Disk stats (read/write):
sdb: ios=71807/6, merge=0/0, ticks=38465149/1014, in_queue=38430241, util=100.00%
缓存监控:[root@localhost log]# hdparm -Tt /dev/sdb
/dev/sdb:
Timing cached reads: 7024 MB in 2.00 seconds = 3514.55 MB/sec
Timing buffered disk reads: 14 MB in 3.76 seconds = 3.73 MB/sec
[root@localhost log]#
针对上面两个测试命令的结果,结合缓存监控做以详细分析,看结果是否合理
最新发布