找回密码
 加入我们
搜索
      
查看: 2508|回复: 17

[NAS] Truenas scale 下 zfs 关闭 ARC 的性能测试

[复制链接]
发表于 2024-5-27 21:48 | 显示全部楼层 |阅读模式
本帖最后由 elvba 于 2024-5-28 12:19 编辑

正常来说,没有谁会把 zfs 的 ARC 关闭来使用,之所以有这个测试,是使用 fio 测试不同阵列组合下 zfs 的性能时,想到 zfs 有 ARC 做缓存,这样无法测试到阵列的原始性能,所以做了这个测试。
跑完之后发现有无 ARC 的性能差距实在是太大了,得到的结论是就应该多加内存提高 ARC 容量。
并且也无需关闭 ARC 来进行阵列性能对比测试,毕竟正常使用都是开启 ARC 的。

测试环境:
CPU:16 x Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
内存:32G
阵列卡:lsi 9211-8i 直通模式,pcie2.0 x 8 插槽,SAS2008 控制器,两个SFF-8087 接口,每个接口提供半双工 2.4G/s,全双工 4.8G/s 的带宽
硬盘笼:浪潮 5212M4 机头
硬盘:12 个 WD Elements 12TB 拆盒盘

测试方法:
使用 fio 命令进行测试,参数如下:


  1. fio --output=io_test.log --output-format=normal,terse,json+ fio.conf

  2. [global]
  3. ioengine=psync
  4. iodepth=1
  5. direct=1
  6. thread=1
  7. numjobs=1
  8. filename=test
  9. norandommap=1
  10. runtime=20
  11. ramp_time=5
  12. size=50G
  13. group_reporting
  14. stonewall

  15. [write4k_rand]
  16. bs=4k
  17. rw=randwrite

  18. [read4k_rand]
  19. bs=4k
  20. rw=randread

  21. [write128k_seq]
  22. bs=128k
  23. rw=write

  24. [read128k_seq]
  25. bs=128k
  26. rw=read
复制代码



关闭 arc 的方法:
zfs set primarycache=none pool_name

测试结果:



发表于 2024-5-28 01:33 | 显示全部楼层
https://s21.ax1x.com/2024/05/27/pk1nF7q.png
楼主图连接的图床,在部分地区看不到的
发表于 2024-5-28 01:40 来自手机 | 显示全部楼层
这差距我想到的是btrfs不行主要是cache不行
发表于 2024-5-28 02:25 | 显示全部楼层
zfs可以两级缓存吗?内存+本地nvme
发表于 2024-5-28 07:17 来自手机 | 显示全部楼层
赫敏 发表于 2024-5-28 02:25
zfs可以两级缓存吗?内存+本地nvme

可以l2arc
 楼主| 发表于 2024-5-28 11:52 | 显示全部楼层
赫敏 发表于 2024-5-28 02:25
zfs可以两级缓存吗?内存+本地nvme

可以,但是实际效果一般,没太大必要用。
只有在内存容量不够用的时候考虑开启,不然起反效果。
 楼主| 发表于 2024-5-28 12:19 | 显示全部楼层
YoshinoSakura 发表于 2024-5-28 01:33
https://s21.ax1x.com/2024/05/27/pk1nF7q.png
楼主图连接的图床,在部分地区看不到的


我换了个图床,现在试试能看到吗?
发表于 2024-5-28 12:47 来自手机 | 显示全部楼层
赫敏 发表于 2024-5-28 02:25
zfs可以两级缓存吗?内存+本地nvme

l2arc 就是干这个的
发表于 2024-5-28 14:12 | 显示全部楼层
zfs可以考虑用zil加速同步写操作,本身没并有用固态做写缓存的功能,l2arc只能做读缓存
发表于 2024-5-28 14:45 | 显示全部楼层
elvba 发表于 2024-5-28 12:19
我换了个图床,现在试试能看到吗?

现在能
发表于 2024-5-28 14:54 | 显示全部楼层
sas2008?这东西机械盘都跑不满没有任何测试的意义
发表于 2024-5-28 16:15 | 显示全部楼层
  1. root@go[~]# fio --group_reporting=1 --name=fio_test --ioengine=psync --iodepth=1 --direct=1 --thread --rw=randwrite --size=4G --bs=4k --numjobs=1 --time_based=1 --runtime=30s -filename=/mnt/Main/E/Test/FIO/fio.test
  2. fio_test: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
  3. fio-3.28
  4. Starting 1 thread
  5. fio_test: Laying out IO file (1 file / 4096MiB)
  6. Jobs: 1 (f=1): [w(1)][100.0%][w=1658MiB/s][w=424k IOPS][eta 00m:00s]
  7. fio_test: (groupid=0, jobs=1): err= 0: pid=380836: Tue May 28 16:13:22 2024
  8.   write: IOPS=394k, BW=1538MiB/s (1612MB/s)(45.0GiB/30000msec); 0 zone resets
  9.     clat (nsec): min=1591, max=1261.3k, avg=2297.76, stdev=4862.82
  10.      lat (nsec): min=1621, max=1261.4k, avg=2323.95, stdev=4864.78
  11.     clat percentiles (nsec):
  12.      |  1.00th=[  1896],  5.00th=[  1944], 10.00th=[  1976], 20.00th=[  2008],
  13.      | 30.00th=[  2024], 40.00th=[  2064], 50.00th=[  2064], 60.00th=[  2096],
  14.      | 70.00th=[  2128], 80.00th=[  2192], 90.00th=[  2320], 95.00th=[  2448],
  15.      | 99.00th=[  2832], 99.50th=[  3152], 99.90th=[ 97792], 99.95th=[113152],
  16.      | 99.99th=[166912]
  17.    bw (  MiB/s): min=  528, max= 1691, per=99.89%, avg=1535.93, stdev=319.16, samples=58
  18.    iops        : min=135276, max=433078, avg=393196.97, stdev=81705.03, samples=58
  19.   lat (usec)   : 2=15.47%, 4=84.26%, 10=0.10%, 20=0.02%, 50=0.01%
  20.   lat (usec)   : 100=0.06%, 250=0.09%, 500=0.01%, 750=0.01%, 1000=0.01%
  21.   lat (msec)   : 2=0.01%
  22.   cpu          : usr=13.36%, sys=85.55%, ctx=35095, majf=0, minf=0
  23.   IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  24.      submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  25.      complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  26.      issued rwts: total=0,11808523,0,0 short=0,0,0,0 dropped=0,0,0,0
  27.      latency   : target=0, window=0, percentile=100.00%, depth=1

  28. Run status group 0 (all jobs):
  29.   WRITE: bw=1538MiB/s (1612MB/s), 1538MiB/s-1538MiB/s (1612MB/s-1612MB/s), io=45.0GiB (48.4GB), run=30000-30000msec
复制代码

  1. fio --group_reporting=1 --name=fio_test --ioengine=psync --iodepth=1 --direct=1 --thread --rw=randwrite --size=4G --bs=128k --numjobs=1 --time_based=1 --runtime=30s -filename=/mnt/Main/E/Test/FIO/fio.test
  2. fio_test: (g=0): rw=randwrite, bs=(R) 128KiB-128KiB, (W) 128KiB-128KiB, (T) 128KiB-128KiB, ioengine=psync, iodepth=1
  3. fio-3.28
  4. Starting 1 thread
  5. fio_test: Laying out IO file (1 file / 4096MiB)
  6. Jobs: 1 (f=1): [w(1)][100.0%][w=10.1GiB/s][w=82.9k IOPS][eta 00m:00s]
  7. fio_test: (groupid=0, jobs=1): err= 0: pid=380872: Tue May 28 16:14:58 2024
  8.   write: IOPS=76.4k, BW=9545MiB/s (10.0GB/s)(280GiB/30001msec); 0 zone resets
  9.     clat (usec): min=4, max=762, avg=12.42, stdev=10.15
  10.      lat (usec): min=4, max=764, avg=12.82, stdev=10.24
  11.     clat percentiles (usec):
  12.      |  1.00th=[   10],  5.00th=[   10], 10.00th=[   11], 20.00th=[   11],
  13.      | 30.00th=[   12], 40.00th=[   12], 50.00th=[   12], 60.00th=[   12],
  14.      | 70.00th=[   12], 80.00th=[   12], 90.00th=[   13], 95.00th=[   14],
  15.      | 99.00th=[   81], 99.50th=[  106], 99.90th=[  133], 99.95th=[  143],
  16.      | 99.99th=[  174]
  17.    bw (  MiB/s): min= 4044, max=10844, per=99.98%, avg=9542.31, stdev=1937.16, samples=59
  18.    iops        : min=32359, max=86754, avg=76338.02, stdev=15497.31, samples=59
  19.   lat (usec)   : 10=8.27%, 20=90.20%, 50=0.45%, 100=0.38%, 250=0.71%
  20.   lat (usec)   : 500=0.01%, 750=0.01%, 1000=0.01%
  21.   cpu          : usr=6.15%, sys=93.04%, ctx=35238, majf=0, minf=0
  22.   IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
  23.      submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  24.      complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
  25.      issued rwts: total=0,2290766,0,0 short=0,0,0,0 dropped=0,0,0,0
  26.      latency   : target=0, window=0, percentile=100.00%, depth=1

  27. Run status group 0 (all jobs):
  28.   WRITE: bw=9545MiB/s (10.0GB/s), 9545MiB/s-9545MiB/s (10.0GB/s-10.0GB/s), io=280GiB (300GB), run=30001-30001msec
复制代码
 楼主| 发表于 2024-5-28 17:39 | 显示全部楼层
Juzi丶 发表于 2024-5-28 14:54
sas2008?这东西机械盘都跑不满没有任何测试的意义

为啥会跑不满?跑的时候我用 iostat 看了,除了关闭 arc 的 4k 单线程读写外,其他场景下每个磁盘都是满载了,测试结果的带宽也没超过 sas2008 的上限。
发表于 2024-9-15 17:14 | 显示全部楼层
zfs set primarycache=none data用这个命令关不掉呀
发表于 2024-9-15 17:48 | 显示全部楼层
proxmox 8.2 默认就给zfs 16g内存,事实16g也够了,家用环境根本不需要大内存
发表于 2024-9-22 18:49 | 显示全部楼层
zfs不用ecc到底能不能跑啊,我的gen8太老了想换,打算搞个12th的普通板U不打算折腾ecc了,ARC还能开起来吗
发表于 2024-9-22 19:00 来自手机 | 显示全部楼层
helleon 发表于 2024-9-22 18:49
zfs不用ecc到底能不能跑啊,我的gen8太老了想换,打算搞个12th的普通板U不打算折腾ecc了,ARC还能开起来吗 ...

没问题,那里那么多内存错误
发表于 2024-9-22 19:06 | 显示全部楼层
litguy 发表于 2024-9-22 19:00
没问题,那里那么多内存错误

感谢,才发现其实楼主也不是ecc
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

Archiver|手机版|小黑屋|Chiphell ( 沪ICP备12027953号-5 )沪公网备310112100042806 上海市互联网违法与不良信息举报中心

GMT+8, 2024-9-28 21:17 , Processed in 0.013084 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2007-2024 Chiphell.com All rights reserved.

快速回复 返回顶部 返回列表