NFS3 vs NFS4

Steph007

Member
Mar 2, 2016
9
0
21
47
Hi There,

Isn't NFS4 suppose to outperform NFS3 ? I've been running some tests and either and most likely I'm doing something wrong but it seems like NFS3 outperform NFS4 with at least 80%... Perhaps some optimization is required?

Server config : /etc/exports;
/home *(rw,async,fsid=0,no_root_squash,no_subtree_check)

NFS3 results

root@pve2:~# mount -t nfs -o nfsvers=3,rw,relatime,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.50.0.2,mountport=20048,mountproto=udp,local_lock=none,addr=10.50.0.2 10.50.0.2:/home /mnt/nas/
root@pve2:~# pveperf /mnt/nas/
CPU BOGOMIPS: 76802.40
REGEX/SECOND: 1085059
HD SIZE: 1276.51 GB (10.50.0.2:/home)
FSYNCS/SECOND: 2055.07
DNS EXT: 222.60 ms
DNS INT: 10.09 ms (bbi.co.bw)
root@pve2:~#

NFS4 results

root@pve2:~# mount -t nfs -o nfsvers=4,rw,relatime,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.50.0.2,mountport=20048,mountproto=udp,local_lock=none,addr=10.50.0.2 10.50.0.2:/ /mnt/nas/

root@pve2:~# pveperf /mnt/nas/
CPU BOGOMIPS: 76802.40
REGEX/SECOND: 1079439
HD SIZE: 1276.51 GB (10.50.0.2:/)
FSYNCS/SECOND: 1126.22
DNS EXT: 305.20 ms
DNS INT: 10.24 ms (bbi.co.bw)

-steph
 
I would only use NFS4 if you need other access controls then per ip/subnet. Also if NFS4 use NFS 4.1 - pure NFS4 has a lot of problems.

Also VMware use NFS3 and not NFS4 - they started in version 6 to initally support it
Why you need NFS4?

Can you pls post your sysctl.conf?
 
I just have an uncontrollable urge to fiddle with everything :) It's honestly not a big deal and the only reason I asked is because most articles I could get my hands on claimed a 20 to 30% speed increase when using NFS4.

My sysctl.conf is pretty stock , haven't changed anything specific and everything seems to be commented out.

Is there any reason why my "pveperf" doesn't report any buffered reads ?

Thanks in advance,
-steph
 
Ok then you should do some tuning on the tcp stack to get more performance.

net.ipv4.tcp_max_tw_buckets = 180000
net.ipv4.tcp_mem = 3622080 4829440 7244160
net.ipv4.tcp_wmem = 40960 163840 41943040
net.ipv4.tcp_rmem = 40960 873800 41943040
net.ipv4.udp_mem = 363168 484224 726336
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 16777216
net.core.wmem_default = 16777216
sunrpc.tcp_slot_table_entries = 128

put this in your sysctl and then do a sysctl -p

this should help to increase your nfs perfomance.
 
Hello,
The mount point is not the same (10.50.0.2:/home vs 10.50.0.2:/). Please reproduce same initial conditions for the compared tests ?
Furthermore, fsync is not the only metric to look at...