正文
Windows 磁盘部分性能数据获取
摘要
每次晚上加班总有收获
这次发现了一个fio for windows版本的压测程序, 准备学习和使用一下.
https://github.com/axboe/fio/releases
安装
exe 的正常安装不用都说直接使用就可以了.
注意我这变使用的是 x64版本的.
测试脚本
fio -name=128k -filename=c:\io.speedtest -runtime=30 -direct=1 -bs=128k -rw=write -size=4g --iodepth=16 --thread
fio -name=8k -filename=c:\io.speedtest -runtime=30 -direct=1 -bs=8k -rw=randwrite -size=4g --iodepth=16 --thread
fio -name=8krw -filename=c:\io.speedtest -runtime=30 -direct=1 -bs=8k -rw=randrw -rwmixread=70 -size=4g --iodepth=16 --thread
fio -name=8kread -filename=c:\io.speedtest -runtime=30 -direct=1 -bs=8k -rw=read -size=4g --iodepth=16 --thread
注意不同的测试脚本分别对应测试:
128KB顺序写
8K 随机写
8K 随机读写,并且70%的读操作, 这个是数据库常用的个处理
8K 顺序读 一般这个会到协议的顶峰. 如果这个到不了就可以改成128KB 的区块大小
需要注意. windows 平台不支持 多线程测试, 这里是需要注意的.
IOPS和带宽数值越大越好. 太低的数值, 会带来一些问题.
注意实际测试中最好加大runtime时间和文件大小最好能够击穿raid卡的缓存或者是磁盘缓存 这样测试结果才是正确的.
自己笔记本的测试结果
C:\Users\zhaobsh>fio -name=128k -filename=c:\io.speedtest -runtime=30 -direct=1 -bs=128k -rw=write -size=4g --iodepth=16
fio: this platform does not support process shared mutexes, forcing use of threads. Use the 'thread' option to get rid of this warning.
128k: (g=0): rw=write, bs=(R) 128KiB-128KiB, (W) 128KiB-128KiB, (T) 128KiB-128KiB, ioengine=windowsaio, iodepth=16
fio-3.34
Starting 1 thread
128k: Laying out IO files (2 files / total 4096MiB)
Jobs: 1 (f=2): [W(1)][100.0%][w=110MiB/s][w=882 IOPS][eta 00m:00s]
128k: (groupid=0, jobs=1): err= 0: pid=27928: Mon Mar 20 23:37:12 2023
write: IOPS=1036, BW=130MiB/s (136MB/s)(3886MiB/30001msec); 0 zone resets
slat (usec): min=155, max=27079, avg=963.76, stdev=1015.93
clat (nsec): min=608, max=63591k, avg=7544673.60, stdev=5145554.51
lat (usec): min=174, max=63819, avg=8508.44, stdev=5273.46
clat percentiles (nsec):
| 1.00th=[ 1224], 5.00th=[ 522240], 10.00th=[ 1253376],
| 20.00th=[ 2834432], 30.00th=[ 4358144], 40.00th=[ 5603328],
| 50.00th=[ 7045120], 60.00th=[ 8454144], 70.00th=[10027008],
| 80.00th=[11730944], 90.00th=[13697024], 95.00th=[15663104],
| 99.00th=[23461888], 99.50th=[26869760], 99.90th=[34865152],
| 99.95th=[39059456], 99.99th=[54263808]
bw ( KiB/s): min=67840, max=204288, per=100.00%, avg=132981.93, stdev=22042.15, samples=59
iops : min= 530, max= 1596, avg=1038.58, stdev=172.19, samples=59
lat (nsec) : 750=0.10%, 1000=0.51%
lat (usec) : 2=0.95%, 4=0.16%, 10=0.04%, 20=0.02%, 50=0.01%
lat (usec) : 250=0.62%, 500=2.45%, 750=1.79%, 1000=1.63%
lat (msec) : 2=6.30%, 4=13.05%, 10=41.98%, 20=28.56%, 50=1.81%
lat (msec) : 100=0.02%
cpu : usr=0.00%, sys=3.33%, ctx=0, majf=0, minf=0
IO depths : 1=1.8%, 2=13.1%, 4=26.2%, 8=52.4%, 16=6.5%, 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=93.9%, 8=0.0%, 16=6.1%, 32=0.0%, 64=0.0%, >=64=0.0%
issued rwts: total=0,31084,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=16
Run status group 0 (all jobs):
WRITE: bw=130MiB/s (136MB/s), 130MiB/s-130MiB/s (136MB/s-136MB/s), io=3886MiB (4074MB), run=30001-30001msec
C:\Users\zhaobsh>fio -name=128k -filename=d:\io.speedtest -runtime=30 -direct=1 -bs=128k -rw=write -size=4g --iodepth=16 --thread
128k: (g=0): rw=write, bs=(R) 128KiB-128KiB, (W) 128KiB-128KiB, (T) 128KiB-128KiB, ioengine=windowsaio, iodepth=16
fio-3.34
Starting 1 thread
128k: Laying out IO files (2 files / total 4096MiB)
Jobs: 1 (f=2): [W(1)][100.0%][w=96.0MiB/s][w=767 IOPS][eta 00m:00s]
128k: (groupid=0, jobs=1): err= 0: pid=28128: Mon Mar 20 23:38:30 2023
write: IOPS=982, BW=123MiB/s (129MB/s)(3684MiB/30001msec); 0 zone resets
slat (usec): min=159, max=20981, avg=1016.39, stdev=1085.95
clat (nsec): min=529, max=40496k, avg=7963163.20, stdev=5295680.79
lat (usec): min=181, max=42443, avg=8979.55, stdev=5397.27
clat percentiles (nsec):
| 1.00th=[ 1064], 5.00th=[ 489472], 10.00th=[ 1269760],
| 20.00th=[ 2932736], 30.00th=[ 4620288], 40.00th=[ 6062080],
| 50.00th=[ 7438336], 60.00th=[ 8847360], 70.00th=[10420224],
| 80.00th=[12255232], 90.00th=[15138816], 95.00th=[17170432],
| 99.00th=[21626880], 99.50th=[25296896], 99.90th=[31588352],
| 99.95th=[34340864], 99.99th=[37486592]
bw ( KiB/s): min=96830, max=167011, per=100.00%, avg=126208.25, stdev=24663.83, samples=59
iops : min= 756, max= 1304, avg=985.68, stdev=192.63, samples=59
lat (nsec) : 750=0.34%, 1000=0.56%
lat (usec) : 2=0.74%, 4=0.16%, 10=0.03%, 20=0.01%, 50=0.01%
lat (usec) : 250=0.54%, 500=2.68%, 750=1.75%, 1000=1.57%
lat (msec) : 2=5.64%, 4=11.85%, 10=41.36%, 20=30.82%, 50=1.95%
cpu : usr=0.00%, sys=3.33%, ctx=0, majf=0, minf=0
IO depths : 1=1.8%, 2=13.1%, 4=26.2%, 8=52.3%, 16=6.5%, 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=93.9%, 8=0.0%, 16=6.1%, 32=0.0%, 64=0.0%, >=64=0.0%
issued rwts: total=0,29475,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=16
Run status group 0 (all jobs):
WRITE: bw=123MiB/s (129MB/s), 123MiB/s-123MiB/s (129MB/s-129MB/s), io=3684MiB (3863MB), run=30001-30001msec