I’ve been having a problem with using NFSv3 and OpenSuSE - the performance of NFSv3 is substantially worse than NFSv4 or SMB (26.2MB/s for NFSv3, compared to 63.7MB/s for NFSv4). Also, SMB beats them all (92MB/s), but the internet seems to say NFS should win. I have experienced this when both serverA and serverB were running 12.3, and when both are running 13.1.
Does anyone have any ideas as to why this is the case? I’m thinking it is due to a configuration parameter somewhere. Any help on improving the performance would be much appreciated.
Configuration
ServerA - hosts the NFS mount point.
/etc/exports
/mnt/raid0/nfstest 192.168.1.0/24(rw)
ServerB - connects to the NFS server, serverA
NFSv4
command
# mount -t nfs serverA:/mnt/raid0/nfstest /mnt/nfstest-v4
mount output
serverA:/mnt/raid0/nfstest on /mnt/nfstest-v4 type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.233,local_lock=none,addr=192.168.1.244)
**
NFSv3**
command
# mount -t nfs serverA:/mnt/raid0/nfstest /mnt/nfstest-v3 -o nfsvers=3,vers=3
mount output
serverA:/mnt/raid0/nfstest on /mnt/nfstest-v3 type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.244,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=192.168.1.244)
SMB
command
# mount -t cifs //serverA/nfstest /mnt/nfstest-smb
mount output
//serverA/nfstest on /mnt/nfstest-smb type cifs (rw,relatime,vers=1.0,cache=strict,username=userX,domain=serverA,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.244,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,actimeo=1)
Results
Using the following command -
time dd if=/dev/zero of=test_file_TYPE bs=1M count=100
… the results were:
**NFSv4
**
linux:/mnt/nfstest-v4 # time dd if=/dev/zero of=test_file_v4 bs=1M count=100100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 1.64518 s, **63.7 MB/s**
real 0m1.649s
user 0m0.008s
sys 0m0.096s
NFSv3
linux:/mnt/nfstest-v3 # time dd if=/dev/zero of=test_file_v3 bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 3.99598 s, **26.2 MB/s**
real 0m4.146s
user 0m0.004s
sys 0m0.108s
SMB
linux:/mnt/nfstest-smb # time dd if=/dev/zero of=test_file_smb bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 1.1323 s, **92.6 MB/s**
real 0m1.192s
user 0m0.000s
sys 0m0.256s