fio 输出在两个位置显示两个带宽数字(用于读取和写入)。这两个数字代表什么?吞吐量测试应考虑哪一项,而另一项应考虑什么目的?
1 {JOB}:{1}_{4k}_{5}: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodep th=32
2 ...
3 fio-3.1
4 Starting 16 threads
5
6 {JOB}:{1}_{4k}_{5}: (groupid=0, jobs=16): err= 0: pid=143919: Thu Oct 10 18:35:14 2019
7 read: IOPS=50.1k, BW=196MiB/s (205MB/s)(34.4GiB/180002msec)
8 slat (nsec): min=1210, max=191233, avg=3335.76, stdev=1810.98
9 clat (usec): min=166, max=16660, avg=695.21, stdev=319.44
10 lat (usec): min=169, max=16662, avg=698.62, stdev=319.39
11 clat percentiles (usec):
12 | 1.00th=[ 338], 5.00th=[ 396], 10.00th=[ 433], 20.00th=[ 482],
13 | 30.00th=[ 515], 40.00th=[ 537], 50.00th=[ 570], 60.00th=[ 685],
14 | 70.00th=[ 832], 80.00th=[ 914], 90.00th=[ 1012], 95.00th=[ 1188],
15 | 99.00th=[ 1532], 99.50th=[ 2057], 99.90th=[ 3490], 99.95th=[ 3884],
16 | 99.99th=[ 5997]
17 bw ( KiB/s): min= 5883, max=16873, per=6.26%, avg=12545.77, stdev=3041.02, samples=5760
18 iops : min= 1470, max= 4218, avg=3136.15, stdev=760.26, samples=5760
19 write: IOPS=952k, BW=3720MiB/s (3901MB/s)(654GiB/180002msec)
20 slat (nsec): min=1192, max=927014, avg=3640.66, stdev=1926.60
21 clat (usec): min=98, max=10023, avg=496.01, stdev=170.79
22 lat (usec): min=100, max=10025, avg=499.72, stdev=170.69
23 clat percentiles (usec):
24 | 1.00th=[ 273], 5.00th=[ 326], 10.00th=[ 355], 20.00th=[ 388],
25 | 30.00th=[ 420], 40.00th=[ 445], 50.00th=[ 457], 60.00th=[ 474],
26 | 70.00th=[ 486], 80.00th=[ 510], 90.00th=[ 865], 95.00th=[ 930],
27 | 99.00th=[ 1004], 99.50th=[ 1029], 99.90th=[ 1188], 99.95th=[ 1287],
28 | 99.99th=[ 1467]
29 bw ( KiB/s): min=121170, max=307136, per=6.26%, avg=238474.82, stdev=57541.32, samples=5760
30 iops : min=30292, max=76784, avg=59618.41, stdev=14385.36, samples=5760
31 lat (usec) : 100=0.01%, 250=0.25%, 500=73.65%, 750=12.84%, 1000=11.71%
32 lat (msec) : 2=1.52%, 4=0.02%, 10=0.01%, 20=0.01%
33 cpu : usr=6.39%, sys=33.77%, ctx=40608436, majf=0, minf=11562
34 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=100.0%, >=64=0.0%
35 submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
36 complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.1%, 64=0.0%, >=64=0.0%
37 issued rwt: total=9019565,171442027,0, short=0,0,0, dropped=0,0,0
38 latency : target=0, window=0, percentile=100.00%, depth=32
39
40 Run status group 0 (all jobs):
41 READ: bw=196MiB/s (205MB/s), 196MiB/s-196MiB/s (205MB/s-205MB/s), io=34.4GiB (36.9GB), run=180002-180002msec
42 WRITE: bw=3720MiB/s (3901MB/s), 3720MiB/s-3720MiB/s (3901MB/s-3901MB/s), io=654GiB (702GB), run=180002-180002mse c
43
44 Disk stats (read/write):
45 nvme1n1: ios=9013394/171326957, merge=0/0, ticks=6201303/82738341, in_queue=103287914, util=100.00%
例如,对于阅读,以下是相关行
7: read: IOPS=50.1k, BW=196MiB/s (205MB/s)(34.4GiB/180002msec)
17: bw ( KiB/s): min= 5883, max=16873, per=6.26%, avg=12545.77, stdev=3041.02, samples=5760
41: READ: bw=196MiB/s (205MB/s), 196MiB/s-196MiB/s (205MB/s-205MB/s), io=34.4GiB (36.9GB), run=180002-180002msec
第 7 行中的“BW”表示什么,第 17 行中的“bw”表示什么?它们有何不同?对于吞吐量测试,应该考虑哪一项?
答案1
读/写/修剪
[...] BW 是平均带宽速率,显示为:2 格式的幂值(10 格式的幂值)。
[...]
体重
基于样本的带宽统计
一个(BW)是total I/O / time
另一个(bw)是通过对作业运行时在某个设定时间段收集的样本进行平均来计算的(请注意samples=5760
行尾)。如果由于旧版本的 fio 中的错误而同时运行多个作业,示例数据可能看起来非常奇怪(使用更新的 fio 可能会得到更合理的结果 - 请参阅https://github.com/axboe/fio/releases以获得最新版本)。
吞吐量测试应考虑哪一项,而另一项应考虑什么目的?
BW 是您通常想要查看的内容,但 bw 的采样统计数据(例如 max、min、stdev)可能是一个强烈的警告信号,表明出现了严重错误(但请参阅上面旧版 fio 版本的警告)。
答案2
我认为 Sitsofe Wheeler 给出了更全面的答案https://www.spinics.net/lists/fio/msg05517.html他们写道:
BW 是每秒的平均值。 bw 是平均值的平均值...
BW 的计算方法是对您执行的所有 I/O (1189MiB) 求和并除以以秒为单位的时间,因此
(1189*1024.0)/(13001/1000.0)/1024 ~ 91.5
bw 是通过将 bw 日志中的所有“值”相加并除以这些值的数量来计算的。每个值本身都是某种平均值,但您不知道它已经过了哪个时期。这可能会导致很大的差异。
想象一下我有一个运行两秒钟的作业。在第一秒内,10 MB 的数据通过两个 I/O 完成。在第二秒内,通过两个 I/O 完成 100MByte。 BW将是
120 / 2 = 60MBytes/s
。然而想象一下 bw 值是这样的0. 10240, 0, 0 0, 10240, 0, 1024 1, 102400, 0, 2048 1, 102400, 0, 3072 (10240 * 2 + 102400 * 2)/4.0/1024.0 = 55.0
每个 bw 条目的平均时间段不一定是已知的,并且如果条目在除一秒以外的时间内进行平均,则“平均值的平均值”也不会是每秒。我想知道这(KiB/s)是否真的具有误导性......
这是我自己测试中的一个更令人震惊的例子:
512M: (groupid=0, jobs=1): err= 0: pid=15001: Sun Sep 6 22:45:26 2020
write: IOPS=0, BW=153MiB/s (161MB/s)(45.0GiB/301044msec); 0 zone resets
slat (msec): min=103, max=4290, avg=2819.80, stdev=988.46
clat (msec): min=11, max=13196, avg=9817.42, stdev=1824.07
lat (msec): min=2825, max=17272, avg=13162.17, stdev=1957.18
clat percentiles (msec):
| 1.00th=[ 12], 5.00th=[ 8020], 10.00th=[ 8087], 20.00th=[ 8658],
| 30.00th=[ 9060], 40.00th=[ 9597], 50.00th=[10134], 60.00th=[10268],
| 70.00th=[10671], 80.00th=[10939], 90.00th=[11610], 95.00th=[12147],
| 99.00th=[13221], 99.50th=[13221], 99.90th=[13221], 99.95th=[13221],
| 99.99th=[13221]
bw ( KiB/s): min=1046483, max=1048576, per=100.00%, avg=1048454.31, stdev=492.65, samples=86
iops : min= 1, max= 2, avg= 1.94, stdev= 0.24, samples=86
lat (msec) : 20=1.11%
cpu : usr=3.17%, sys=2.22%, ctx=185445, majf=0, minf=21
IO depths : 1=1.1%, 2=2.2%, 4=96.7%, 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,90,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=4
Run status group 0 (all jobs):
WRITE: bw=153MiB/s (161MB/s), 153MiB/s-153MiB/s (161MB/s-161MB/s), io=45.0GiB (48.3GB), run=301044-301044msec
其中整个运行的平均速度显示为 153 MiB/s,但带宽采样率为 1024 MiB/s (iiuc)。