Linux Track NFS Directory / Disk I/O Stats

See all Troubleshooting related FAQ
How do I track NFS (network filesystem) client metrics (disk I/O) on Linux operating system?

You can use any one of the following tool/files to get stats about NFS on Linux operating systems:
Advertisement

  1. The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation to their average transfer rates. The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks.
  2. Another recommended option is to use nfsstat command to displays statistics kept about NFS client and server activity, active user activity, exported directories, and mount information. In the absence of any options, nfsstat displays NFS client and server statistics.
  3. Tutorial details
    Difficulty level Intermediate
    Root privileges Yes
    Requirements None
    Est. reading time 2 minutes
  4. /proc/net/rpc/nfsd – procfs-based interface to kernel NFS server statistics. Use cat command to see stats.
  5. /proc/net/rpc/nfs – procfs-based interface to kernel NFS client statistics. Use cat command to see nfs client stats.
  6. /proc/mounts – procfs-based interface to the mounted filesystems

iostat command syntax and examples

The -n option displays the NFS-directory statistic. Data displayed are valid only with kernels 2.6.17 and newer. This option is exclusive to the -x option:
# iostat -x -n
OR
# iostat -n
Sample outputs:

Linux 2.6.32-358.23.2.el6.x86_64 (server1.cyberciti.biz) 	11/11/2013 	_x86_64_	(8 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.30    0.00    0.43    0.03    0.00   98.24

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.04    91.47    0.19  100.13     7.12  1532.82    15.35     0.14    1.35   0.08   0.83

Say hello to nfstat command

The nfsstat displays statistics kept about NFS client and server activity:
# nfsstat
Sample outputs:

Fig.01: nfsstat in action

Fig.01: nfsstat in action

Show all information about all versions of NFS

# nfsstat -o all -234
OR
# nfsstat --verbose -234

Show all information about active versions of NFS

# nfsstat -o all

Show statistics for NFS version 3 server

# nfsstat --nfs --server -3

Show information about mounted NFS filesystems

# nfsstat -m

Recommend readings
  1. How to find out CPU and Disk utilization under Linux using iostat command.
  2. Man pages:
This entry is 10 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

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

2 comments… add one
  • Richard Mar 21, 2008 @ 8:54

    cat /proc/net/rpc/nfsd and nfsstat for a basic informations.
    The project munin draw graphs for nfs client, nfsd, iostats, …
    http://munin.projects.linpro.no/

  • Cory Walker May 29, 2014 @ 17:27

    Root privileges are not needed on most installations.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.