Tuning NFS client/server stack-Collection of common programming errors

For our RHEL/CentOS 5 machines we use the following mount flags

nfsvers=3,tcp,timeo=600,retrans=2,rsize=32768,wsize=32768,hard,intr,noatime

Newer Linux kernel version support even larger rsize/wsize parameters, but 32k is the maximum for the 2.6.18 kernel in EL5.

On the NFS server(s), at least for Linux no_wdelay supposedly helps if you have a disk controller with BBWC. Also, if you use the noatime flag on the clients, it probably makes sense to mount the filesystems on the servers with noatime as well.

And, as was already mentioned, don’t bother with UDP. With higher speed networks (1GbE+) there is a small, but non-zero, chance of a sequence number wraparound causing data corruption. Also, if there is a possibility of packet loss, TCP will perform better than UDP.

If you’re not worrying about data integrity that much, the “async” export option can be a major performance improvement (the problem with async is that you might lose data if the server crashes).

Also, at least for Linux server, you need to make sure you have enough NFS server threads running. The default 8 is just way too low.