The nfsiostat command works as iostat command for the NFS mount points on the server. It uses the file /proc/self/mountstats as input and provides information about the input/output performance of NFS shares mounted in the system. Below table displays a short description.
|This is the number of operations per second.
|This is the length of the backlog queue.
|This is the number of kB written/read per second.
|This is the number of kB written/read per each operation.
|This is the number of retransmissions.
|avg RTT (ms)
|This is the duration from the time that client’s kernel sends the RPC request until the time it receives the reply.
|avg exe (ms)
|This is the duration from the time that NFS client does the RPC request to its kernel until the RPC request is completed, this includes the RTT time above.
nfsiostat command syntax
Below is a syntax to use the nfsiostat command.
# nfsiostat --help Usage: nfsiostat [interval] [count] [options] [mount point] Options: --version show program's version number and exit -h, --help show this help message and exit Statistics Options: File I/O is displayed unless one of the following is specified: -a, --attr displays statistics related to the attribute cache -d, --dir displays statistics related to directory operations -p, --page displays statistics related to the page cache Display Options: Options affecting display format: -s, --sort Sort NFS mount points by ops/second -l LIST, --list=LIST only print stats for first LIST mount points
interval – time in seconds between each report.
count – number of reports to be generated at [interval] seconds apart. If you do not specify the count here, the report will be generated countinuously at the specified interval.
options – The various options are explained in the examples below.
mount_point – you can specify a specific NFS mount point for which the stats to be displayed. In this case report only for the specified mount point is generated.
Examples of nfsiostat command
1. Running nfsiostat without any arguments
When you run nfsiostat with interval as an argument, then the difference from previous interval will be displayed, otherwise the results will be from the time that the share was mounted.
# nfsiostat 126.96.36.199:/data01 mounted on /data01: op/s rpc bklog 0.08 0.00 read: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) 0.052 6.436 124.154 0 (0.0%) 9.365 9.617 write: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) 0.001 0.214 199.536 0 (0.0%) 5.673 72.526
2. Running nfsiostat at particular interval
You can run the nfsiostat command at a particular interval for infinite time. Do not provide the [count] argument in that case. For example, to run the nfsiostat command continuously at the interval of 5 seconds:
# nfsiostat 5
If you do not want nfsiostat to run continuously and only want a finite number of reports, use the [count] argument with the [interval] argument. For example, to produce 10 reports at the interval of 5 seconds using the below command.
# nfsiostat 5 10
3. Running nfsiostat only for a specific mount point
In case if you have several mount NFS mount points on the server and you are only concerned about a specific NFS mount point only, you can use the below command to display statistics of that mount point only.
# nfsiostat 5 5 /particular/mount/point
4. Sorting output by operations per second
To sort the report output by operations per second on NFS mount points use the ‘
-s‘ or ‘
–sort‘ argument. For example,
# nfsiostat -s
5. Displaying statistics related a specific parameter
If you only want to display io statistics pertaining to a particular parameter, you can use below options with the nfsiostat command.
a– displays statistics related to the attribute cache
d– displays statistics related to directory operations
p– displays statistics related to the page cache