NFS Tuning

Note: I mainly discovered, that the defaults set by the maintainers are most likely to work very well. I'd only increase the RPCNFSDCOUNT and leave the rest alone..

setup

→ Server (Debian9, Proxmox, 1Gbit/s Intel NIC, Target => 8TB WD RED)

# proxmox with zpools attached
# export via `zfs set sharenfs=<params>`:
zfs set sharenfs=<params>,rw=@192.168.8.0/24 <pool>
systemctl reload nfs-kernel-server
# verify:
cat /proc/fs/nfsd/exports

→ Client (macOS 10.12.6, 1Gbit/s Realtek NIC)

CMD+K (Connect to Server) → nfs://192.168.8.3/mnt/<pool>

tuning options

→ NFS-DAEMON

# Adjusting parameters in /etc/default/nfs-kernel-server

# increasing the Number of daemons
# default = 8
# Rule of Thumb: Cores * 8 + 1.25 * Memory in GB
# 2 Cores + 4GB RAM => ~24T
# 4 Cores + 16GB RAM => ~56T
# 16 Cores + 128GB RAM => ~256T
# depending on how heavy your nfs server is used.
RPCNFSDCOUNT=56

# verify with:
systemctl restart nfs-kernel-server
ps -aux | grep nfs | grep -v grep | wc -l

→ NFS-EXPORT

Check your default with

tests

→ starting point

# Export Options:
async,insecure,no_subtree_check,all_squash,anonuid=0,anongid=100,rw=@192.168.8.0/24

Screen Shot 2018-10-03 at 10.03.14


# Export Options:
async,insecure,no_subtree_check,all_squash,anonuid=0,anongid=100,rw=@192.168.8.0/24

Screen Shot 2018-10-03 at 10.11.53


# Server: Change Thread Count
-- RPCNFSDCOUNT=8
++ RPCNFSDCOUNT=56

Screen Shot 2018-10-03 at 10.36.04


sudo mkdir /Volumes/rxd01 && sudo mount -t nfs -o soft,intr,rsize=8192,wsize=8192,timeo=900,retrans=3,proto=tcp 192.168.8.3:/mnt/rxd01 ${_}

Screen Shot 2018-10-03 at 10.55.06


sudo mkdir /Volumes/rxd01 && sudo mount -t nfs -o resvport,nolocks,locallocks,intr,soft,wsize=32768,rsize=3276 192.168.8.3:/mnt/rxd01 ${_}

Screen Shot 2018-10-03 at 10.58.25


→ Previous with async

Screen Shot 2018-10-03 at 11.04.31

comments

Overall the defaults provide good performance. I found that with zfs using async is not an issue at all so this is probably the most notable difference. When using macOS I can recommend using the cli mount instead of the GUI mount as it also perfoms slightly better, and appears to be more stable.

Using more threads is also very recommended, especially when you're in a mutliuser environment. For Home Users with 1 or 2 people not that big of a deal.