Mount NFS File System Over a Slow and Busy Network

Posted on in Categories , , , , , , , last updated May 3, 2017

Traffic between my home and office data center encrypted using VPN but sometime my ISP get little slow or network becomes busy. I’m using Fedora Core Linux desktop system and my system freezes for a few minutes. What optimization options should be used when mounting an exported NFS share over a slow and busy network?

Generally, you will see server not responding message or computer just freezes. You can pass the following option while mounting remote shared/exported NFS server:

  1. soft: This option allows the kernel to time out if the nfs server is not responding for some time. The time can be specified with timeo=time. This option might be useful if your nfs server sometimes doesn’t respond or will be rebooted while some process tries to get a file from the server.
  2. timeo N: This timeout value is expressed in tenths of a second
  3. retrans : The number of timeouts allowed before the client gives up and displays the Server not responding message. The mount fails soon after.
  4. proto tcp/udp: The protocol (Either TCP or UDP) used when attempting to mount the server.

For example:
# mount -t nfs -o soft,timeo=900,retrans=3,vers=3, proto=tcp remotenfsserver:/home/data /mnt/nfs-mnt-point
OR
# mount.nfs4 -o soft,timeo=900,retrans=3,vers=3, proto=tcp nas01:/data /data

This entry is 9 of 15 in the Linux / UNIX NFS File Server Tutorial series. Keep reading the rest of the series:
  1. CentOS / Redhat: Setup NFS v4.0 File Server
  2. Debian / Ubuntu Linux: Setup NFSv4 File Server
  3. Mac Os X: Mount NFS Share / Set an NFS Client
  4. RHEL: How Do I Start and Stop NFS Service?
  5. How To Restart Linux NFS Server Properly When Network Become Unavailable
  6. Linux Iptables Allow NFS Clients to Access the NFS Server
  7. Debian / Ubuntu Linux Disable / Remove All NFS Services
  8. Linux: Tune NFS Performance
  9. Mount NFS file system over a slow and busy network
  10. Linux Track NFS Directory / Disk I/O Stats
  11. Linux Disable / Remove All NFS Services
  12. Linux: NFS4 mount Error reason given by server: No such file or directory
  13. Linux NFS Mount: wrong fs type, bad option, bad superblock on fs2:/data3 Error And Solution
  14. CentOS / RHEL CacheFS: Speed Up Network File System (NFS) File Access
  15. Increase NFS Client Mount Point Security

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

2 comment

  1. The Linux manpage for MOUNT_NFS(8) specifically states that changing the timeo value is useful when optimizing UDP mounts. If the timeo value only affects UDP mounts specifying “proto=tcp” would make the value for timeo moot would it not?

Leave a Comment