Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments

NFS and RPC statistics

Command for displaying NFS and RPC statistics  Top

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.

Syntax of the nfsstat command  Top

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

Options of the nfsstat command  Top

The following table describes the options of the nfsstat command.

Option

Description

None

When you do not specify an option, the command displays statistical information gathered since the last time the filer was rebooted or the statistics counters were reset.

interval

When you specify an interval, the command displays statistics continually. The interval specifies the number of seconds the command waits between updates.

-h

Displays statistics on a per-client basis. You can provide the client's host name or IP address as an argument to the -h option. To use the -h option, you must enable the nfs.per_client_stats.enable option. If no argument is provided, the -h option displays statistics for all known clients.

-l

Reports the number of NFS requests that have been received from each NFS client.

-z

Resets the NFS event counters.

-c

Displays reply cache statistics.

-t

Displays statistics since boot time rather than since the last time they were zeroed.

-d

Displays reply cache statistics and statistics about incoming messages and allocated mbufs.

When to enable per-client statistics  Top

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, but be aware that doing so will clear all NFS statistics on the filer.

Enabling the nfs.per_client_
stats.enable option  Top

To enable the nfs.per_client_stats.enable option, complete the following step.

Step

Action

1

Enter the following command:

options nfs.per_client_stats.enable on

Example with no options  Top

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 use of 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%

Example with the -l option  Top

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%)

Example with the -h option  Top

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%

Example with the -c option  Top

The following command displays similar information as nfsstat with no options, as well as the 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 -t option  Top

The following command displays output since the last system boot:

nfsstat -t

Example with the -d option  Top

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

Library Table of Contents Index Previous Page (Alt-p) Next Page (Alt-n) Comments