NFS IOPS Performance on FreeBSD NVMe Storage

Jedi Marcus

New Member
Mar 18, 2020
3
0
1
Luxembourg, Europe
Watching too much Linus Tech Tips, I did buy a Gigabyte Server:
R272-Z32 with 8x 1.97TB Samsung NVMe Drives.

I setup a raidz2 on the 8 drives on a FreeBSD system with a goal of doing sharing over NFS (eventually for VM hosting in XCP-ng).

I have a test scenario with the 5 following tests:
Test 1 (IOPS Random Read):
fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
Test 2 (IOPS Seq Read):
fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=read
Test 3 (IOPS Seq Write):
fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=write
Test 4 (MiB/s Read):
fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=read --ramp_time=4
Test 5 (MiB/s Write):
fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=write --ramp_time=4


Running the tests on the local FreeBSD machine, I get the following results:
Test 1: 73'000 IOPS
Test 2: 493'000 IOPS
Test 3: 221'000 IOPS
Test 4: 5767 MB/s
Test 5: 2866 MB/s


Doing the same tests on another server on the NFS share (10Gbit Network), I get the following results:
Test 1: 4'100 IOPS
Test 2: 5'700 IOPS
Test 3: 5'600 IOPS
Test 4: 948 MB/s
Test 5: 920 MB/s


I'm happing with Test 4 & 5 which seem to almost max out my 10Gbit/s network, but the IOPS performance is horrible.

To get to this point, I did enable Jumbo Frames & disable the sync option on the ZFS dataset.

My problem is the IOPS performance.
Even my old NetApp non-NVMe scored almost 10x values on Test 3.

Does anyone know where I need to tweak?
ZFS dataset?
NFS Server?
NFS Client?

Any help is appreciated.

Best regards,

MM
 
Last edited:

Rand__

Well-Known Member
Mar 6, 2014
5,355
1,133
113
Network access is slow...
I assume your old NetApp was attached via FC? Thats designed for low latency

If you're not stuck on FreeBSD you could use an RDMA capable system (eg with ZoL).
O/c you can also try iWarp which runs on FreeBSD.

Else...
your pool layout is not the best for IOPS, your test might be skewed heavily by the small test size which would fit into memory, and also a very high qd (but single process) is not a particular realistic test [most likely]
 
Last edited:

Rand__

Well-Known Member
Mar 6, 2014
5,355
1,133
113
Here are the same tests from my pool

See that the IOPS barely differ between sync and async operations? Thats due to the fact that these are network bound, not CPU bound.

Please disregard the fact that my async writes are slower than the sync writes, I have a NVDimm slog which is faster than the pool disks at a single process.



Sync
Code:
#Test 1 (IOPS Random Read):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=64
fio-3.16
Starting 1 process
test: Laying out IO file (1 file / 4096MiB)
Jobs: 1 (f=1): [m(1)][100.0%][r=30.5MiB/s,w=10.0MiB/s][r=7803,w=2566 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=20850: Fri Dec  4 19:03:05 2020
  read: IOPS=7225, BW=28.2MiB/s (29.6MB/s)(3070MiB/108763msec)
   bw (  KiB/s): min=23720, max=34416, per=99.99%, avg=28900.24, stdev=1918.48, samples=217
   iops        : min= 5930, max= 8604, avg=7225.03, stdev=479.62, samples=217
  write: IOPS=2414, BW=9660KiB/s (9892kB/s)(1026MiB/108763msec); 0 zone resets
   bw (  KiB/s): min= 7952, max=11728, per=100.00%, avg=9658.90, stdev=651.05, samples=217
   iops        : min= 1988, max= 2932, avg=2414.71, stdev=162.76, samples=217
  cpu          : usr=2.41%, sys=7.96%, ctx=1067278, majf=0, minf=6
  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=785920,262656,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=28.2MiB/s (29.6MB/s), 28.2MiB/s-28.2MiB/s (29.6MB/s-29.6MB/s), io=3070MiB (3219MB), run=108763-108763msec
  WRITE: bw=9660KiB/s (9892kB/s), 9660KiB/s-9660KiB/s (9892kB/s-9892kB/s), io=1026MiB (1076MB), run=108763-108763msec
root@linuxtest:/mnt/nfs# #Test 2 (IOPS Seq Read):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=read
test: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=64
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [R(1)][100.0%][r=34.0MiB/s][r=8952 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=20920: Fri Dec  4 19:04:47 2020
  read: IOPS=10.3k, BW=40.3MiB/s (42.2MB/s)(4096MiB/101706msec)
   bw (  KiB/s): min=28752, max=49360, per=100.00%, avg=41240.11, stdev=4313.61, samples=203
   iops        : min= 7188, max=12340, avg=10309.99, stdev=1078.40, samples=203
  cpu          : usr=1.71%, sys=7.47%, ctx=1173345, majf=0, minf=8
  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=1048576,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=40.3MiB/s (42.2MB/s), 40.3MiB/s-40.3MiB/s (42.2MB/s-42.2MB/s), io=4096MiB (4295MB), run=101706-101706msec
root@linuxtest:/mnt/nfs# #Test 3 (IOPS Seq Write):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=write
test: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=64
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [W(1)][100.0%][w=34.2MiB/s][w=8747 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=20967: Fri Dec  4 19:06:39 2020
  write: IOPS=9389, BW=36.7MiB/s (38.5MB/s)(4096MiB/111674msec); 0 zone resets
   bw (  KiB/s): min=10416, max=50984, per=99.98%, avg=37549.26, stdev=7747.82, samples=223
   iops        : min= 2604, max=12746, avg=9387.26, stdev=1936.99, samples=223
  cpu          : usr=1.92%, sys=8.36%, ctx=1106264, majf=0, minf=9
  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=0,1048576,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
  WRITE: bw=36.7MiB/s (38.5MB/s), 36.7MiB/s-36.7MiB/s (38.5MB/s-38.5MB/s), io=4096MiB (4295MB), run=111674-111674msec
root@linuxtest:/mnt/nfs# #Test 4 (MiB/s Read):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=read --ramp_time=4
test: (g=0): rw=read, bs=(R) 4096KiB-4096KiB, (W) 4096KiB-4096KiB, (T) 4096KiB-4096KiB, ioengine=psync, iodepth=256
fio-3.16
Starting 1 process
test: Laying out IO file (1 file / 10240MiB)
Jobs: 1 (f=1): [R(1)][69.2%][r=1277MiB/s][r=319 IOPS][eta 00m:04s]
test: (groupid=0, jobs=1): err= 0: pid=21172: Fri Dec  4 19:06:57 2020
  read: IOPS=307, BW=1230MiB/s (1290MB/s)(5960MiB/4844msec)
   bw (  MiB/s): min= 1136, max= 1320, per=100.00%, avg=1230.56, stdev=66.11, samples=9
   iops        : min=  284, max=  330, avg=307.56, stdev=16.51, samples=9
  cpu          : usr=0.17%, sys=10.18%, ctx=14390, majf=0, minf=15
  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=1490,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=256

Run status group 0 (all jobs):
   READ: bw=1230MiB/s (1290MB/s), 1230MiB/s-1230MiB/s (1290MB/s-1290MB/s), io=5960MiB (6250MB), run=4844-4844msec
root@linuxtest:/mnt/nfs# #Test 5 (MiB/s Write):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=write --ramp_time=4
test: (g=0): rw=write, bs=(R) 4096KiB-4096KiB, (W) 4096KiB-4096KiB, (T) 4096KiB-4096KiB, ioengine=psync, iodepth=256
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [W(1)][53.8%][w=1456MiB/s][w=364 IOPS][eta 00m:06s]
test: (groupid=0, jobs=1): err= 0: pid=21267: Fri Dec  4 19:10:34 2020
  write: IOPS=352, BW=1411MiB/s (1479MB/s)(4508MiB/3195msec); 0 zone resets
   bw (  MiB/s): min= 1248, max= 1488, per=99.98%, avg=1410.67, stdev=85.82, samples=6
   iops        : min=  312, max=  372, avg=352.67, stdev=21.45, samples=6
  cpu          : usr=2.38%, sys=10.99%, ctx=19950, majf=0, minf=15
  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=0,1127,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=256

Run status group 0 (all jobs):
  WRITE: bw=1411MiB/s (1479MB/s), 1411MiB/s-1411MiB/s (1479MB/s-1479MB/s), io=4508MiB (4727MB), run=3195-3195msec
Sync Off
Code:
#Test 1 (IOPS Random Read):
fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=write --ramp_time=4root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
test: (g=0): rw=randrw, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=64
fio-3.16
Starting 1 process

Jobs: 1 (f=1)
Jobs: 1 (f=1): [m(1)][100.0%][r=28.5MiB/s,w=9617KiB/s][r=7300,w=2404 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=21321: Fri Dec  4 19:14:12 2020
  read: IOPS=7241, BW=28.3MiB/s (29.7MB/s)(3070MiB/108537msec)
   bw (  KiB/s): min=21696, max=34856, per=99.98%, avg=28958.73, stdev=2298.82, samples=217
   iops        : min= 5424, max= 8714, avg=7239.64, stdev=574.70, samples=217
  write: IOPS=2419, BW=9680KiB/s (9912kB/s)(1026MiB/108537msec); 0 zone resets
   bw (  KiB/s): min= 7152, max=11816, per=100.00%, avg=9678.52, stdev=797.12, samples=217
   iops        : min= 1788, max= 2954, avg=2419.60, stdev=199.27, samples=217
  cpu          : usr=1.80%, sys=7.81%, ctx=1149043, majf=0, minf=7
  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=785920,262656,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=28.3MiB/s (29.7MB/s), 28.3MiB/s-28.3MiB/s (29.7MB/s-29.7MB/s), io=3070MiB (3219MB), run=108537-108537msec
  WRITE: bw=9680KiB/s (9912kB/s), 9680KiB/s-9680KiB/s (9912kB/s-9912kB/s), io=1026MiB (1076MB), run=108537-108537msec
root@linuxtest:/mnt/nfs# #Test 2 (IOPS Seq Read):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=read
test: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=64
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [R(1)][100.0%][r=32.8MiB/s][r=8408 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=21374: Fri Dec  4 19:16:05 2020
  read: IOPS=9311, BW=36.4MiB/s (38.1MB/s)(4096MiB/112606msec)
   bw (  KiB/s): min= 8368, max=46608, per=99.98%, avg=37240.28, stdev=5477.47, samples=225
   iops        : min= 2092, max=11652, avg=9310.03, stdev=1369.39, samples=225
  cpu          : usr=1.89%, sys=7.79%, ctx=1084673, majf=0, minf=8
  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=1048576,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
   READ: bw=36.4MiB/s (38.1MB/s), 36.4MiB/s-36.4MiB/s (38.1MB/s-38.1MB/s), io=4096MiB (4295MB), run=112606-112606msec
root@linuxtest:/mnt/nfs# #Test 3 (IOPS Seq Write):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=write
test: (g=0): rw=write, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=64
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [W(1)][100.0%][w=35.4MiB/s][w=9071 IOPS][eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=21426: Fri Dec  4 19:17:53 2020
  write: IOPS=9760, BW=38.1MiB/s (39.0MB/s)(4096MiB/107427msec); 0 zone resets
   bw (  KiB/s): min=27352, max=50000, per=99.99%, avg=39039.05, stdev=3973.49, samples=214
   iops        : min= 6838, max=12500, avg=9759.72, stdev=993.38, samples=214
  cpu          : usr=1.75%, sys=8.64%, ctx=1162792, majf=0, minf=6
  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=0,1048576,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=64

Run status group 0 (all jobs):
  WRITE: bw=38.1MiB/s (39.0MB/s), 38.1MiB/s-38.1MiB/s (39.0MB/s-39.0MB/s), io=4096MiB (4295MB), run=107427-107427msec
root@linuxtest:/mnt/nfs# #Test 4 (MiB/s Read):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=read --ramp_time=4
test: (g=0): rw=read, bs=(R) 4096KiB-4096KiB, (W) 4096KiB-4096KiB, (T) 4096KiB-4096KiB, ioengine=psync, iodepth=256
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [R(1)][50.0%][r=1220MiB/s][r=304 IOPS][eta 00m:07s]
test: (groupid=0, jobs=1): err= 0: pid=21484: Fri Dec  4 19:18:00 2020
  read: IOPS=316, BW=1267MiB/s (1329MB/s)(3896MiB/3074msec)
   bw (  MiB/s): min=  904, max= 1560, per=100.00%, avg=1269.33, stdev=226.54, samples=6
   iops        : min=  226, max=  390, avg=317.33, stdev=56.63, samples=6
  cpu          : usr=0.52%, sys=8.04%, ctx=12613, majf=0, minf=15
  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=974,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=256

Run status group 0 (all jobs):
   READ: bw=1267MiB/s (1329MB/s), 1267MiB/s-1267MiB/s (1329MB/s-1329MB/s), io=3896MiB (4085MB), run=3074-3074msec
root@linuxtest:/mnt/nfs# #Test 5 (MiB/s Write):
root@linuxtest:/mnt/nfs# fio --randrepeat=1 --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4M --iodepth=256 --size=10G --readwrite=write --ramp_time=4
test: (g=0): rw=write, bs=(R) 4096KiB-4096KiB, (W) 4096KiB-4096KiB, (T) 4096KiB-4096KiB, ioengine=psync, iodepth=256
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [W(1)][57.1%][w=1221MiB/s][w=305 IOPS][eta 00m:06s]
test: (groupid=0, jobs=1): err= 0: pid=21499: Fri Dec  4 19:18:10 2020
  write: IOPS=308, BW=1235MiB/s (1295MB/s)(5168MiB/4186msec); 0 zone resets
   bw (  MiB/s): min= 1128, max= 1269, per=99.51%, avg=1228.49, stdev=46.84, samples=8
   iops        : min=  282, max=  317, avg=306.88, stdev=11.59, samples=8
  cpu          : usr=3.01%, sys=8.12%, ctx=14632, majf=0, minf=15
  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=0,1292,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=256

Run status group 0 (all jobs):
  WRITE: bw=1235MiB/s (1295MB/s), 1235MiB/s-1235MiB/s (1295MB/s-1295MB/s), io=5168MiB (5419MB), run=4186-4186msec
 
  • Like
Reactions: itronin