nfsv3 Provider
The nfsv3 provider provides probes for tracing NFS version 3 server activity.
Arguments
All NFS operation probes have the first argument in common:
The conninfo_t structure is already used by the iSCSI target provider (iscsi) and the NFS v4 provider (nfsv4), and is intended for use by all provider which are providing some higher level protocol (e.g. iscsi, nfs, http, ftp).
Operation probes have their second argument in common:
Top
Probes
Below is a list of the probes along with the specific argument for each whose type is defined by the NFS v3 specification:
| probe name |
args[2] |
| nfsv3:::op-access-start |
ACCESS3args * |
| nfsv3:::op-access-done |
ACCESS3res * |
| nfsv3:::op-commit-start |
COMMIT3args * |
| nfsv3:::op-commit-done |
COMMIT3res * |
| nfsv3:::op-create-start |
CREATE3args * |
| nfsv3:::op-create-done |
CREATE3res * |
| nfsv3:::op-fsinfo-start |
FSINFO3args * |
| nfsv3:::op-fsinfo-done |
FSINFO3res * |
| nfsv3:::op-fsstat-start |
FSSTAT3args * |
| nfsv3:::op-fsstat-done |
FSSTAT3res * |
| nfsv3:::op-getattr-start |
GETATTR3args * |
| nfsv3:::op-getattr-done |
GETATTR3res * |
| nfsv3:::op-lookup-start |
LOOKUP3args * |
| nfsv3:::op-lookup-done |
LOOKUP3res * |
| nfsv3:::op-link-start |
LINK3args * |
| nfsv3:::op-link-done |
LINK3res * |
| nfsv3:::op-mkdir-start |
MKDIR3args * |
| nfsv3:::op-mkdir-done |
MKDIR3res * |
| nfsv3:::op-mknod-start |
MKNOD3args * |
| nfsv3:::op-mknod-done |
MKNOD3res * |
| nfsv3:::op-null-start |
- |
| nfsv3:::op-null-done |
- |
| nfsv3:::op-pathconf-start |
PATHCONF3args * |
| nfsv3:::op-pathconf-done |
PATHCONF3res * |
| nfsv3:::op-read-start |
READ3args * |
| nfsv3:::op-read-done |
READ3res * |
| nfsv3:::op-readdir-start |
READDIR3args * |
| nfsv3:::op-readdir-done |
READDIR3res * |
| nfsv3:::op-readdirplus-start |
READDIRPLUS3args * |
| nfsv3:::op-readdirplus-done |
READDIRPLUS3res * |
| nfsv3:::op-readlink-start |
READLINK3args * |
| nfsv3:::op-readlink-done |
READLINK3res * |
| nfsv3:::op-remove-start |
REMOVE3args * |
| nfsv3:::op-remove-done |
REMOVE3res * |
| nfsv3:::op-renamestart |
RENAME3args * |
| nfsv3:::op-rename-done |
RENAME3res * |
| nfsv3:::op-rmdir-start |
RMDIR3args * |
| nfsv3:::op-rmdir-done |
RMDIR3res * |
| nfsv3:::op-setattr-start |
SETATTR3args * |
| nfsv3:::op-setattr-done |
SETATTR3res * |
| nfsv3:::op-symlink-start |
SYMLINK3args * |
| nfsv3:::op-symlink-done |
SYMLINK3res * |
| nfsv3:::op-write-start |
WRITE3args * |
| nfsv3:::op-write-done |
WRITE3res * |
Note that op-null-* probes have an undefined args[2].
Top
Examples
Some simple examples of nfsv3 provider usage follow.
nfsv3rwsnoop.d
This DTrace scripts traces NFSv3 read and write requests, showing details of each operation:
The following output shows a read of /export/stuff/bin/ghex2, then a read of /export/stuff/bin/gksu, and finally a write of /export/stuff/words12:
The fields printed are:
| field |
description |
| TIME(us) |
Time of event in microseconds |
| CLIENT |
Remote client IP address |
| OP |
R == read, W == write |
| OFFSET |
File offset of I/O, in Kbytes |
| BYTES |
Bytes of I/O |
| PATHNAME |
Pathname of file, if known |
Note: The output may be shuffled slightly on multi-CPU servers due to DTrace per-CPU buffering; post sort the TIME column if needed.
nfsv3ops.d
This DTrace script counts NFSv3 operations by client, printing a summary every 5 seconds:
The following output shows which client is sending which NFSv3 operations:
The fields printed are:
| field |
description |
| Client |
Remote client IP address |
| Operation |
NFSv3 operation, described using the nfsv3 provider probename |
| Count |
Operations during this interval |
nfsv3fileio.d
This DTrace script prints a summary of file read and write bytes:
This output shows a few files were read, and one was written:
The fields printed are:
| field |
description |
| Rbytes |
Bytes read for this pathname |
| Wbytes |
Bytes written to this pathname |
| Pathname |
Pathname of NFS file |
nfsv3rwtime.d
This DTrace script prints a summary NFSv3 read and write elapsed times (latencies), along with other details:
This output below shows a clear peak in the read time distribution plot in the 64 to 127 microsecond range, and a second smaller peak between 4 and 16 milliseconds:
Other details are printed, such as total read/write latency by host, and the top 10 files by latency.
The next example also shows a pair of peaks, the first around a fraction of a millisecond, the second at around 4 milliseconds:
The first peak is likely to be NFS operations hitting the memory cache, and the second those that missed and went to disk. Further use of DTrace can confirm this theory.
The fields from the distribution plot are:
| field |
description |
| value |
Minimum elapsed time for this event in microseconds |
| count |
Number of events in this time range |
nfsv3io.d
This is a simple DTrace script to provide basic I/O details by host every 5 seconds:
This output shows 192.168.17.75 calling NFSv3 reads and writes:
Other details can be calculated from the output, such as average read and write size (eg, 686(kr/s) / 27(r/s) = 25.4 average kr). These could also be added to the script to be printed as columns.
The fields printed are:
| field |
description |
| Client |
Remote client IP address |
| r/s |
reads per second |
| w/s |
writes per second |
| kr/s |
kilobytes read per second |
| kw/s |
kilobytes written per second |
| ops/s |
total NFSv3 operations per second (including the reads and writes) |