Linux: Tune NFS Performance

by on March 4, 2008 · 4 comments· LAST UPDATED September 7, 2011

in , ,

What values can be tuned to improve NFS performance? How do I improve my client performance under Linux operating systems?

The mount command (mount.nfs4 and mount.nfs) allows you to fine tune NFS mounting to improve NFS server and client performance. However, there is no one-size-fits-all approach to NFS performance tuning. Servers can be configured for handling different workloads and may need to be tuned as per your setup. Please test and monitor both your server and client systems as you test different tuning options.

Recommended NFS Tuning Options For the Mount Command

  • noacl: Disables Access Control List (ACL) processing.
  • nocto: Suppress the retrieval of new attributes when creating a file.
  • rsize: The number of bytes NFS uses when reading files from an NFS server. The rsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller. Note: Setting this size to a value less than the largest supported block size will adversely affect performance.
  • wsize: The number of bytes NFS uses when writing files to an NFS server. The wsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller. Note: Setting this size to a value less than the largest supported block size will adversely affect performance.
  • noatime: Setting this value disables the NFS server from updating the inodes access time. As most applications do not necessarily need this value, you can safely disable this updating.
  • nodiratime: Setting this value disables the NFS server from updating the directory access time. This is the directory equivalent setting of noatime.
  • noac: Disable all forms of attribute caching entirely. This extracts a significant performance penalty but it allows two different NFS clients to get reasonable results when both clients are actively writing to a common export on the server.

Here is sample mount command with the above options:
# mount.nfs -o noacl,nocto, rsize=32768,wsize=32768 nfsserver:/sales /salesdata/

For more information read your local nfs and mount command man pages. Please note that most of the above options are also supported by other UNIX like operating systems such as OpenBSD, FreeBSD, AIX and so on.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 4 comments… read them below or add one }

1 Greg June 15, 2012 at 2:03 am

# mount.nfs -o noacl,nocto, rsize=32768,wsize=32768 nfsserver:/sales /salesdata/
I copy your command except the rsize and wsize. My NFS default is rsize=1048576,wsize=1048576, the result is actually worse than mount it directly with mount nfsserver:/sales /salesdata/
It is not optimized, but worse. Do you know why?

Thanks

Reply

2 Marco July 12, 2012 at 5:55 am

If your MTU is much smaller then I would expect the nfs packets to get fragmented and need to go through reassembly at the other end.

HTH

Reply

3 zaff March 15, 2013 at 11:33 am

I have netapp filesystem mount on my linux host and i have specify below perameter in fstab file. But perfomace is not good and slow. Could you please tell me which would be the right perameter to increase my disk read & write performance ?

rw,fg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp

Your quick response is appreciated.

Reply

4 et0n1c December 2, 2013 at 1:24 pm

Zaff,

I would try to use UDP instead of TCP and see if that makes a difference.
Also, try rw,no_root_squash,no_all_squash,async,insecure,no_subtree_check,nohide for options. That’s always worked great for us.

Tonic, Affordable Hosting @ etonic.net

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: