Score:0

Ubuntu NFS client hangs while writing large file

es flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.