Core: NFS4 very slow write performance. Both Disk, and NFS3 are fine.
So I have an interesting one for Truenas core. A small folder of 2mb, and around 200 small files.
Writes via NFS4 are extremely slow. (>2m to copy this dir) (even with sync=disabled)
Writes locally, or via NFS3 perform as expected. (<1s)
Reads from this dir perform fine locally, via NFS3 or NFS4.
Is the Truenas Core NFS server just slow as for NFS4? Is there something Im missing that could be causing my issue? Because NFS3 performs well.
Some figures:
Local copy of this folder: 0.038 seconds. (cp -a folder test\_folder)
Copy via a client machine using nfs4: 2m21. (cp -a /mnt/nfs4/folder /mnt/nfs4/test\_folder)
Copy via a client machine using nfs3: 0.751s (cp -a /mnt/nfs3/folder /mnt/nfs3/test\_folder)
copy via nfs4 with sync=disabled: 1m20.
copy from nfs4 to a local dir: 0.25s (cp -a /mnt/nfs4/folder /tmp/test\_folder)
Create a VM on the machine running AlmaLinux 9. Attach it to a zvol in the same share, start an NFS server and copy via nfs4: 6.7s.
While copying, via NFS4, nfsd is grabbing around 12% cpu:
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 3536 root 7 -72 0 12M 2176K tx->tx 7 520.5H 11.68% nfsd