Monitoring NFS Server on FreeBSD
I will show you in this tutorial, step-by-step, how to monitor your NFS server on FreeBSD.
There is an awesome tool provided by NFS Server by default called nfsstat, that give you a detailed statistics about your NFS server/client structure activity (number of requests executed read/write, cache hits, server faults, real-time bandwidth or traffic served by nfs server), there is alternatives to it like nfswatch and daemonfs.
nfsstat -d : shows kb/s/transfer, transfers/s, and mb/s for read/write operations, and all operation, and also gives the current queue depth, the busy percentage and latency for all operations.
root@freebsdsrv:~ # nfsstat -d
[===== Read =====] [===== Write ====] [=========== Total ============]
KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s ms ql %b
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0
0.00 0 0.00 64.00 150 9.37 61.57 156 9.37 0.72 0 11
0.00 0 0.00 64.00 175 10.93 63.32 177 10.93 0.27 1 5
0.00 0 0.00 63.58 133 8.25 62.20 136 8.25 1.88 0 26
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0
0.00 0 0.00 0.00 0 0.00 0.00 0 0.00 0.00 0 0
root@freebsdsrv:~ # nfsstat
Client Info:
Rpc Counts:
Getattr Setattr Lookup Readlink Read Write Create Remove
0 0 0 0 0 0 0 0
Rename Link Symlink Mkdir Rmdir Readdir RdirPlus Access
0 0 0 0 0 0 0 0
Mknod Fsstat Fsinfo PathConf Commit
0 0 0 0 0
Rpc Info:
TimedOut Invalid X Replies Retries Requests
0 0 0 0 0
Cache Info:
Attr Hits Misses Lkup Hits Misses BioR Hits Misses BioW Hits Misses
0 0 0 0 0 0 0 0
BioRLHits Misses BioD Hits Misses DirE Hits Misses Accs Hits Misses
0 0 0 0 0 0 0 0
Server Info:
Getattr Setattr Lookup Readlink Read Write Create Remove
3 0 2 0 0 474 0 0
Rename Link Symlink Mkdir Rmdir Readdir RdirPlus Access
0 0 0 0 0 0 0 1
Mknod Fsstat Fsinfo PathConf Commit
0 7 2 0 8
Server Ret-Failed
0
Server Faults
0
Server Cache Stats:
Inprog Idem Non-idem Misses
0 0 0 498
Server Write Gathering:
WriteOps WriteRPC Opsaved
474 474 0
You can read more about nfsstat command on man documentation :
man nfsstat