I keep an NFS home directory, I like having an NFS home directory, but the behavior has never felt right, the bottom just falls out of the throughput at some point and the whole thing just stalls out. I had some success using tcp but it still felt bad.
The statement in the man page for mount_nfs "BUGS Due to the way that Sun RPC is implemented on top of UDP (unreliable datagram), tuning such mounts is really a black art that can only be expected to have limited success." has always intimidated me. But there are only really two things you can tune rsize and wsize, and I am not sure when you would have them different so really only one thing to tune. so nothing to do but roll up my sleeves and get to work.
I wrote a simple write benchmark, testing read speeds in the face of the page cache is harder. so I did not do it.
change_set=${1:-default}
for scale in 7
do
for c in $(jot 20)
do
b_count=$((${RANDOM} * ${scale} ))
dd if=/dev/random of=write_test bs=1024 count=${b_count} 2>&1 |
awk -v bc=${b_count} '/bytes tran/ {print(bc, substr($7, 2))}' |
tee -a write_benchmark.$(uname -n).${change_set}
done
done
rm write_test
started frobenzing the nfs parameters. and ended up with the following plot.
In conclusion setting r and w to 16384 really helps, I still don't get why it slows down the bigger the file is, and I no longer have the very annoying cliff.
If any one has any nfs hints for an OpenBSD client FreeBSD server setup I would love to hear them.
new fstab:
192.168.2.129:/mnt/bulk/home /home nfs noauto,rw,nodev,nosuid,soft,-r=16384,-w=16384 0 0