Speed writing to a nfs share does not match the speed shown in network reporting

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Foxyz

New Member
Aug 2, 2023
9
1
3
Hi guys,

On my linux server i mount a dir using nfs from truenas scale.
When i use dd command writing a 1G file to this dir on the linux server, it says the speed is around 650MB/s, but when i look at the network reporting, it says the max speed is above 9000 Mb/s which is about 1.1GB/s (I’m using a 10G network and a SSD pool, the iperf test shown nothing wrong).

so can anyone tells me why the network traffic is about 2 times than the dd command shows?
And can i make the write speed faster? this is a NVME pool and using dd comand in truenas shell can easily reach above 2GB/s.

by the way, it’s strip pool which only has 1 nvme disk

Thanks a lot!
 

nexox

Well-Known Member
May 3, 2023
1,503
726
113
You'll need to post your exact dd command, it's not really a good benchmark in most cases.
 
  • Like
Reactions: CyklonDX

nexox

Well-Known Member
May 3, 2023
1,503
726
113
O_SYNC/O_DSYNC don't necessarily work the same on NFS as they do on local storage, the network bandwidth spikes you see are likely due to caching somewhere. You'd probably be better off testing performance with a large file copy followed by executing sync and measuring the combined time, though running an actual workload would tell you more than any synthetic benchmark.
 

unwind-protect

Active Member
Mar 7, 2016
593
242
43
Boston
O_SYNC/O_DSYNC don't necessarily work the same on NFS as they do on local storage, the network bandwidth spikes you see are likely due to caching somewhere. You'd probably be better off testing performance with a large file copy followed by executing sync and measuring the combined time, though running an actual workload would tell you more than any synthetic benchmark.
fsync(2) on the file is more likely to flush on the server. I don't think sync(1) has any meaning for NFS.
 
  • Like
Reactions: nexox

nexox

Well-Known Member
May 3, 2023
1,503
726
113
fsync(2) on the file is more likely to flush on the server. I don't think sync(1) has any meaning for NFS.
It should at least flush everything out from the client's buffers, so you can measure average network bandwidth, beyond that requires way more understanding of the configuration of the server and the client.
 

unwind-protect

Active Member
Mar 7, 2016
593
242
43
Boston
It should at least flush everything out from the client's buffers, so you can measure average network bandwidth, beyond that requires way more understanding of the configuration of the server and the client.
fsync(2) should also sync on the server.