The nfsstat command outputs statistical information about the NFS communication between client and server. Information about the following is output:
the number of RPCs (remote procedure calls) sent and received, and any errors which occurred during them. A distinction is made between those RPCs which relate to the computer as a client and those which relate to the computer as server.
the number and type of NFS calls, and any errors which occurred during them. Here too, a distinction is made between those which relate to the computer as a client and those which relate to the computer as server.
You can also use this command to reset the statistics counters and thus define the period for the statistics.
If you enter the command without any options, all statistical information is output. The statistics counters are not reset.
Syntax
nfsstat[ -cnrsz] |
Outputs only information which relates to the computer as a client. |
Outputs only information about NFS calls. |
Outputs only information about RPCs. |
Outputs only information which relates to the computer as server. |
Causes the output and subsequent reset of the statistics counters to 0. The operands listed above determine which statistics counters are to be reset to 0. If only -z is specified, all statistics counters are reset to 0. |
RPC statistics: Server
calls Number of RPCs received |
badcalls Number of RPCs received with errors (the sum of badlen and xdrcall) |
nullrecv Number of RPCs which were unavailable although thought to have been received |
badlen Number of RPCs received with too short a length |
xdrcall Number of RPCs received whose header could not be XDR decoded |
RPC statistics: Client
calls Number of RPCs which were made |
badcalls Number of RPCs which were rejected |
retrans Number of RPC packets which had to be re-transmitted during a call because no acknowledgment or an incorrect acknowledgment was received |
badxid Number of acknowledgments for RPC packets that arrived after the RPC was already completed |
timeout Number of RPC packets transferred during a call for which no reply was received within a certain period of time |
wait Number of calls where it was necessary to wait for internal file structures |
newcred Number of RPCs for which the authentication parameters had to be refreshed by the server computer |
NFS statistics
The NFS statistics are structured similarly for server and client. Information is output on the NFS calls made (calls), the failed NFS calls (badcalls), and a breakdown of the types of the NFS calls made in the form of an absolute number and a percentage.
Additionally, for the client, statistics are included on the number of requests for internal data structures (nclget) and the resulting wait situations (nclsleep).
calls Number of NFS requests sent |
badcalls Number of failed NFS requests |
nclget Details of how often internal data structures were requested |
nclsleep Details of how often it was necessary to wait with nclget |
NFS protocol versions 2 and 3:
null No action (for test purposes) |
getattr Request attributes for a file |
setattr Set attributes for a file |
lookup Locate a file |
readlink Read a symbolic reference |
read Read in a file |
wrcache Write to the buffer |
write Write to a file |
create Create a file |
remove Delete a file |
rename Rename a file |
link Set simple reference |
symlink Set symbolic reference |
mkdir Create directory |
rmdir Delete directory |
readdir Read in a directory |
fsstat Fetch file system information |
NFS protocol version 3 only:
access Check file access rights |
commit Stabilize write request |
fsinfo Fetch static file system information |
fsstat Fetch dynamic file system information |
mknod Create special file |
pathconf Fetch information on the path configuration of a file (maximum path length, maximum number of links, etc.) |
readdirplus Extended reading of directory in accordance with NFS V3 |
Examples
Example 1:
You want to have all the NFS and RPC statistical information output which concerns your local computer as an NFS client.
$ nfsstat -c Client rpc: calls badcalls retrans badxid timeout wait newcred 510690 0 1559 338 1559 0 0 Client nfs version 2: calls badcalls nclget nclsleep 26 0 26 0 null getattr setattr root lookup readlink 0 0% 12 46% 2 7% 0 0% 8 30% 0 0% read wrcache write create remove rename 0 0% 0 0% 1 3% 1 3% 0 0% 0 0% link symlink mkdir rmdir readdir fsstat 0 0% 0 0% 0 0% 0 0% 1 3% 1 3% Client nfs version 3: calls badcalls nclget nclsleep 510661 0 510654 0 null getattr setattr lookup access readlink 0 0% 152 0% 1 0% 285479 55% 2 0% 0 0% read write create mkdir symlink mknod 59776 11% 60164 11% 7 0% 0 0% 0 0% 0 0% remove rmdir rename link readdir readdirplus 66635 13% 0 0% 0 0% 0 0% 36901 7% 0 0% fsstat fsinfo pathconf commit 3 0% 3 0% 2 0% 1537 0%
Example 2:
You want to output all the static information about NFS and RPC in relation to your local computer as NFS server.
$ nfsstat -s Server rpc: calls badcalls nullrecv badlen xdrcall 137514 31720 0 0 0 Server nfs version 2: calls badcalls 1631 0 null getattr setattr root lookup readlink 1 0% 49 3% 0 0% 0 0% 63 3% 3 0% read wrcache write create remove rename 4 0% 0 0% 1479 90% 10 0% 3 0% 0 0% link symlink mkdir rmdir readdir fsstat 0 0% 0 0% 0 0% 0 0% 17 1% 2 0% Server nfs version 3: calls badcalls 104163 0 null getattr setattr lookup access readlink 1 0% 287 0% 0 0% 102264 98% 0 0% 2 0% read write create mkdir symlink mknod 2 0% 1011 0% 311 0% 2 0% 0 0% 0 0% remove rmdir rename link readdir readdirplus 0 0% 0 0% 0 0% 0 0% 278 0% 0 0% fsstat fsinfo pathconf commit 2 0% 2 0% 1 0% 0 0%