gpt4 book ai didi

linux - fio benchmark 延迟说明

转载 作者:太空宇宙 更新时间:2023-11-04 10:14:42 25 4
gpt4 key购买 nike

我使用 fio 对我的 SSD 进行基准测试。但是,我对指定 fsync=1(在每个 write() 之后将脏缓冲区同步到磁盘)参数时报告的延迟感到困惑。

$ fio --name=test_seq_write --filename=test_seq --size=2G --readwrite=write --fsync=1
test_seq_write: (g=0): rw=write, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
fio-2.1.3
Starting 1 process
test_seq_write: Laying out IO file(s) (1 file(s) / 2048MB)
Jobs: 1 (f=1): [W] [100.0% done] [0KB/31968KB/0KB /s] [0/7992/0 iops] [eta 00m:00s]
test_seq_write: (groupid=0, jobs=1): err= 0: pid=10994: Thu Oct 26 09:09:19 2017
write: io=2048.0MB, bw=35647KB/s, iops=8911, runt= 58831msec
clat (usec): min=2, max=1099, avg= 9.42, stdev=18.19
lat (usec): min=2, max=1099, avg= 9.56, stdev=18.28

在这里,iops 是 8911,所以延迟应该大约在 100us 左右。但是,报告的延迟为 9us。我很好奇 fio 是否包括 fsync 的时间?我正在阅读 fio 文档,但没有找到任何解释。

最佳答案

fio 3.5 or later is now able to report fsync latencies !在执行符合以下所有条件的工作负载时,您将看到此信息:

  • 执行某种形式的写入
  • 设置了fsync/fdatasync/sync_file_range之一
  • --output-format为normal(会有fsync/fdatasync/sync_file_range段)或json/json+(值记录在“sync”方向下)。

这是显示 fsync 延迟的正常输出示例:

$ ./fio --filename=/tmp/fio.tmp --size=1m --bs=512 --name=go --rw=write --fdatasync=1
go: (g=0): rw=write, bs=(R) 512B-512B, (W) 512B-512B, (T) 512B-512B, ioengine=psync, iodepth=1
[...]
go: (groupid=0, jobs=1): err= 0: pid=26958: Wed Feb 21 14:06:11 2018
write: IOPS=512k, BW=250MiB/s (262MB/s)(1024KiB/4msec)
clat (nsec): min=673, max=12144, avg=709.40, stdev=260.94
[...]
lat (usec) : 2=0.05%, 4=0.05%, 20=0.05%
fsync/fdatasync/sync_file_range:
sync (nsec): min=353, max=5307, avg=364.78, stdev=115.66
sync percentiles (nsec):
| 1.00th=[ 358], 5.00th=[ 358], 10.00th=[ 358], 20.00th=[ 362],
| 30.00th=[ 362], 40.00th=[ 362], 50.00th=[ 362], 60.00th=[ 362],
| 70.00th=[ 362], 80.00th=[ 362], 90.00th=[ 366], 95.00th=[ 366],
| 99.00th=[ 370], 99.50th=[ 370], 99.90th=[ 402], 99.95th=[ 2064],
| 99.99th=[ 5280]
[...]

所以在回答你的问题时:

I am curious does fio include the time for fsync?

在 fio 3.3 及以下(请参阅 https://stackoverflow.com/a/46968852/9109338 中的更新)。在 fio 3.5 及更高版本中,有点 - fio 在 lat/clat 延迟中不包括 fsync(毕竟它不知道 fsync 延迟应该归因于哪些 I/O' t 检索该信息)但它会自己计算和报告 fsync 延迟。

关于linux - fio benchmark 延迟说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46952571/

25 4 0
文章推荐: linux - 如何将背景图像添加到 Angular 中的
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com