I am running FreeBSD 11.0-RELEASE on two machines. One of them is used as a main file server running the native NFSv3 server (ZFS) using default settings and options. The other connects to this server using the native FreeBSD NFS client. I also have other Linux clients that connect to the FreeBSD NFS server as well.
I noticed that the FreeBSD client seems to be quite a bit slower than the Linux client. The FreeBSD client writes around 46 MB/s compared to Linux client at 105 MB/s which is essentially line speed. I thought maybe this was a network issue between the two FreeBSD boxes, but using iperf3, I have confirmed they transfer at line speed to each other. I have also installed rsync as a daemon and can transfer large files at line speed with no issues. So there are no disk transfer or network issues. It has to be a FreeBSD NFS client issue.
Here are the two OS's mount options:
FreeBSD NFS mount options (nfsstat -m)
Linux NFS mount options (cat /proc/mounts)
Two things I notice immediately. rsize and wsize on the FreeBSD client are half that of the Linux client. I read elsewhere that rsize/wsize of 131072 is the new maximum for the FreeBSD NFS server and that it matches well to chunk sizes of ZFS. I can confirm that it works very well (line speed transfers) on the Linux client. But, why is the FreeBSD client defaulting to half of that?
I tried to force the FreeBSD NFS client to use rsize/wsize value of 131072. It refuses, it seems that the maximum is 65536. I am convinced this is what is causing the performance difference. The Linux client does use UDP for the mount (TCP for the nfsd communication), whereas I believe the FreeBSD client is using TCP for everything. Although I don't believe this is the issue.
Is this rsize/wsize client limitation intended? Is this a bug? Anyone else ran into this?
I noticed that the FreeBSD client seems to be quite a bit slower than the Linux client. The FreeBSD client writes around 46 MB/s compared to Linux client at 105 MB/s which is essentially line speed. I thought maybe this was a network issue between the two FreeBSD boxes, but using iperf3, I have confirmed they transfer at line speed to each other. I have also installed rsync as a daemon and can transfer large files at line speed with no issues. So there are no disk transfer or network issues. It has to be a FreeBSD NFS client issue.
Here are the two OS's mount options:
FreeBSD NFS mount options (nfsstat -m)
jukebox:/media/raid/downloads on /media/jukebox/downloads
nfsv3,tcp,resvport,hard,cto,lockd,sec=sys,acdirmin=3,acdirmax=60,acregmin=5,
acregmax=60,nametimeo=60,negnametimeo=60,rsize=65536,wsize=65536,
readdirsize=65536,readahead=1,wcommitsize=16777216,timeout=120,retrans=2
Linux NFS mount options (cat /proc/mounts)
jukebox:/media/raid/downloads on /media/downloads type nfs (rw,noatime,vers=3,
rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,
retrans=2,sec=sys,mountaddr=192.168.1.6,mountvers=3,mountport=1021,
mountproto=udp,local_lock=none,addr=192.168.1.6)
Two things I notice immediately. rsize and wsize on the FreeBSD client are half that of the Linux client. I read elsewhere that rsize/wsize of 131072 is the new maximum for the FreeBSD NFS server and that it matches well to chunk sizes of ZFS. I can confirm that it works very well (line speed transfers) on the Linux client. But, why is the FreeBSD client defaulting to half of that?
I tried to force the FreeBSD NFS client to use rsize/wsize value of 131072. It refuses, it seems that the maximum is 65536. I am convinced this is what is causing the performance difference. The Linux client does use UDP for the mount (TCP for the nfsd communication), whereas I believe the FreeBSD client is using TCP for everything. Although I don't believe this is the issue.
Is this rsize/wsize client limitation intended? Is this a bug? Anyone else ran into this?