You use the nfsstat command to display statistics about NFS and Remote Procedure Calls (RPCs) for the filer. You can use the output of this command to find performance bottlenecks or inefficiencies in your NFS setup.
Note
A full description of the meaning of NFS statistics is outside the scope of this guide. A good source of information about this topic is Managing NFS and NIS by Hal Stern, O'Reilly & Associates, Inc.
The syntax of the nfsstat command is as follows:
nfsstat [ interval ] | [ -h [ ip_address | host_name ] ] | [ -l ] | [ -z ] | [ -c ] [ -t ]
nfsstat -h [ ip_address | host_name ]
nfsstat -l
nfsstat -z
nfsstat -c
nfsstat -t
nfsstat -d
The following table describes the options for the nfsstat command.
Enable the per-client statistics collection mode (nfsstat -h) before you start the filer, preferably by using the nfs.per_client_stats.enable option in the /etc/rc file. Otherwise, nfsstat -l reports incorrect percentages and displays statistics that include clients that have generated RPC calls but no NFS calls to the client. You can use nfsstat -z to clear this inconsistency; however, be aware that doing so will clear all NFS statistics on the filer.
To enable the nfs.per_client_stats.enable option, complete the following step.
| 1 |
options nfs.per_client_stats.enable on |
The following lines show the output of the nfsstat command when you specify no options and the statistics on the filer have been reset after using the nfsstat
-z command:
nfsstat
Server rpc:
TCP:
calls badcalls nullrecv badlen xdrcall
0 0 0 0 0
UDP:
calls badcalls nullrecv badlen xdrcall
24 0 0 0 0
Server nfs:
calls badcalls
24 0
Server nfs V2: (24 calls)
null getattr setattr root lookup readlink read
0 0% 5 21% 0 0% 0 0% 16 67% 0 0% 0 0%
wrcache write create remove rename link symlink
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
mkdir rmdir readdir statfs
0 0% 0 0% 3 13% 0 0%
Read request stats (version 2)
0-511 512-1023 1K-2047 2K-4095 4K-8191 8K-16383
0 0 0 0 0 0
16K-32767 32K-65535 64K-131071
0 0 0
Write request stats (version 2)
0-511 512-1023 1K-2047 2K-4095 4K-8191 8K-16383
0 0 0 0 0 0
16K-32767 32K-65535 64K-131071
0 0 0
Server nfs V3: (0 calls)
null getattr setattr root lookup readlink read
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
write create mkdir symlink mknod remove rmdir
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
rename link readdir readdir+ fsstat fsinfo pathconf
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
commit
0 0%
Read request stats (version 3)
0-511 512-1023 1K-2047 2K-4095 4K-8191 8K-16383
0 0 0 0 0 0
16K-32767 32K-65535 64K-131071
0 0 0
Write request stats (version 3)
0-511 512-1023 1K-2047 2K-4095 4K-8191 8K-16383
0 0 0 0 0 0
16K-32767 32K-65535 64K-131071
0 0 0
Server nfs V4: (24 calls)
access close commit create delegpurge delegret
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
getattr getfh link lock lockt ocku
3 0% 3 0% 0 0% 0 0% 0 0% 0 0%
lookup lookupp nverify open openattr open_confirm
6 0% 0 0% 0 0% 0 0% 0 0% 0 0%
open_downgrade putfh putpubfh putrootfh read readdir
0 0% 0 0% 0 0% 3 0% 0 0% 0 0%
readlink remove rename renew restorefh savefh
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
secinfo setattr setclntid setclntid_cfm verify write
0 0% 0 0% 9 0% 0 0% 0 0% 0 0%
The following lines show the output of the nfsstat command when you specify the -l option:
nfsstat -l
172.17.25.13 sherlock NFSOPS = 2943506 (90%)
172.17.25.16 watson NFSOPS = 3553686 ( 2%)
172.17.25.18 hudson NFSOPS = 2738083 ( 1%)
172.17.230.7 conan NFSOPS = 673247l ( 3%)
172.17.230.8 baker NFSOPS = 202614527 ( 1%)
172.17.230.9 moriarty NFSOPS = 1006881 ( 0%)
175.17.230.10 doyle NFSOPS = 1185 ( 0%)
The following lines show the output of the nfsstat command when you specify the -h option with a host name:
nfsstat -h eng_host
Client: 172.17.25.3 (eng_host) -------------------------------
Server rpc:
calls badcalls nullrecv badlen xdrcall
33374 0 0 0 0
Server nfs:
calls badcalls
33345 0
Server nfs V2:
null getattr setattr root lookup readlink read
0 0% 8410 25% 19 0% 0 0% 13687 41% 42 0% 489 22%
wrcache write create remove rename link symlink
0 0% 3225 10% 12 0% 7 0% 9 0% 0 0% 0 0%
mkdir rmdir readdir statfs
0 0% 0 0% 416 1% 29 0%
Server nfs V3:
null getattr setattr lookup access readlink read
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
write create mkdir symlink mknod remove rmdir
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
rename link readdir readdir+ fsstat fsinfo pathconf
0 0% 0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
commit
0 0%
Server nfs V4: (24 calls)
access close commit create delegpurge delegret
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
getattr getfh link lock lockt ocku
3 0% 3 0% 0 0% 0 0% 0 0% 0 0%
lookup lookupp nverify open openattr open_confirm
6 0% 0 0% 0 0% 0 0% 0 0% 0 0%
open_downgrade putfh putpubfh putrootfh read readdir
0 0% 0 0% 0 0% 3 0% 0 0% 0 0%
readlink remove rename renew restorefh savefh
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
secinfo setattr setclntid setclntid_cfm verify write
0 0% 0 0% 9 0% 0 0% 0 0% 0 0%
The following command displays similar information as nfsstat with no options, as well as reply cache statistics shown in this example:
nfsstat -c
NFS reply cache statistics:
TCP:
In progress Delay hits Misses Idempotent Non-idempotent
0 0 0 0 0
UDP:
In progress Delay hits Misses Idempotent Non-idempotent
0 0 0 0 0
The following command displays output since the last system boot.
nfsstat -t
The following command displays information similar to that displayed by the nfsstat command with no options; it also displays statistics about reply cache, incoming messages, and allocated mbufs, as shown in this example:
nfsstat -d
nfs cache size=49152, hash size=131072
num msg=0, too many mbufs=0, rpcErr=0, svrErr=0
no msg queued=0, no msg paused=0, no msg dropped=0
no msg unqueued=0, no msg discarded=0
sbfull queued=0, sbfull unqueued=0, sbfull discarded=0
no mbuf queued=0, no mbuf dropped=0
no mbuf unqueued=0, no mbuf discarded=0
(cumulative) active=0/491 req mufs=0
tcp input flowcontrol receive=0, xmit=0
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00322
File: stats11.htm
Last updated: 01/22/03 16:17:23