Network
nfsstat
Display NFS (Network File System) statistics.
Additional Notes
nfsstat displays statistics for Network File System (NFS) operations on both client and server. It shows counts of NFS RPC calls, procedure calls per version, errors, latency information, and throughput data for various NFS operations.
It is used for monitoring NFS performance, diagnosing slow NFS mounts, spotting NFS errors, and tuning NFS parameters. It shows both client-side and server-side statistics depending on the options used.
Syntax
nfsstat [options]
Parameters
options: Flags that change hownfsstatbehaves.target: Optional file, device, interface, user, service, or command target when the command supports one.
Common Options
-s,--server: Show server-side NFS statistics.-c,--client: Show client-side NFS statistics.-a,--all: Show both client and server statistics.-n,--nfs: Show NFS protocol statistics.-r,--rpc: Show RPC statistics.-m,--mounts: Show mounted NFS filesystem information.-o items: Select specific items to display (e.g.,-o all,-o proc,-o net).-2,-3,-4: Show statistics for NFS version 2, 3, or 4.-v: Verbose output.-l: List NFS filesystems.--live: Query the kernel directly for live statistics.--zero: Reset statistics to zero after displaying.
Examples
nfsstat
Show a summary of NFS and RPC statistics.
nfsstat -c
Show only client-side statistics.
nfsstat -s -n
Show only server-side NFS protocol statistics.
nfsstat -4
Show NFS version 4 statistics.
nfsstat -m
Show currently mounted NFS shares and their mount options.
nfsstat --live -c
Query live kernel statistics without reading from /proc/net/rpc/.
Practical Notes
- NFS client statistics are stored in
/proc/net/rpc/nfs/; server stats in/proc/net/rpc/nfsd/. - A high number of
READorWRITEoperations with errors can indicate network issues or server overload. nfsstat -mshows the actual mount options in effect, which is useful for troubleshooting mount issues.- For real-time monitoring, combine with
watch nfsstat -c.