I am hosting an NFS server on my Synology NAS. It is configured via the in-built NFS server under File Services. The configuration options are somewhat limited and I have set 32kb read/write packet size and max NFS version is 4.1.
The /etc/exports entry is:
/volume1/NAS_Andrew 192.168.0.0/24(rw,async,no_wdelay,crossmnt,insecure,all_squash,insecure_locks,sec=sys,anonuid=1024,anongid=100)
My ubuntu client has the following fstab entry:
192.168.0.219:/volume1/NAS_Andrew /mnt/nas nfs nofail,nconnect=16,rsize=32000,wsize=32000,hard 0 0
This resolves to the following entry in /proc/mounts when mounted:
192.168.0.219:/volume1/NAS_Andrew /mnt/nas nfs4 rw,relatime,vers=4.1,rsize=32000,wsize=32000,namlen=255,hard,proto=tcp,nconnect=16,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.220,local_lock=none,addr=192.168.0.219 0 0
The problem is that when I am writing a large file to the NFS mount, all other filesystem operations within the mount hang.
For example, if I run the following in terminal 1:
time dd if=/dev/zero of=/mnt/nas/testfile bs=16k count=128k
and then run ls -la
in terminal 2; the ls
process hangs until the dd
write is complete.
I believe the issue is limited to the local NFS client because if I run the same ls -la
on another server that also has the NFS share mounted - it runs without any hang or issue.
I'm hoping that someone can shed some light as to why the write operation is blocking.
I tried setting nconnect=16
in an effort to increase the tcp connections and allow more than one operation - however this did not work and I suspect nconnect
may be limited to cases where multiple network interfaces are available.
I am running Ubuntu 20.04.3 LTS.
Any input is greatly appreciated.