nfsslower(8)
โจ NFSSLOWER(8) โจ
Heyy bestie, welcome to the nfsslower(8) page from the System Manager's Manual ๐ It's the one for tracing slow NFS file ops ๐ฆ
๐ NAME ๐
nfsslower - Trace slow NFS file operations, with per-event details ๐ง
๐ SYNOPSIS ๐
nfsslower [-h] [-j] [-p PID] [min_ms]
๐ DESCRIPTION ๐
Okay so this tool traces the common NFSv3 & NFSv4 file operations: reads, writes, opens, and getattrs โจ It measures how long each one takes and prints details for every single one that went over a threshold. Main character energy ๐
WARNING: Please go read the OVERHEAD section before you run this ๐
By default the minimum millisecond threshold is 10, so anything 10 ms or slower gets printed. If you set the threshold to 0, every event gets printed. Warning: that is extremely verbose ๐ญ
Real talk, this works by tracing the nfs_file_operations interface functions, so it'll need updating to match any changes to those functions ๐ง
It uses kprobes to instrument the kernel for entry and exit info. In the future, the preferred way would be tracepoints ๐ Right now though, there aren't any tracepoints for nfs_read_file, nfs_write_file and nfs_open_file. nfs_getattr does have entry and exit tracepoints, but we chose kprobes for consistency ๐คทโโ๏ธ
Since this uses BPF, only the root user can use this tool ๐
๐งฐ REQUIREMENTS ๐งฐ
CONFIG_BPF and bcc.
๐ OPTIONS ๐
-p PIDโ Only trace this PID ๐ฏ-jโ Output the trace in CSV format, so it's easy to parse ๐min_msโ The minimum I/O latency (duration) to trace, in milliseconds. The default is 10 ms โฑ๏ธ
๐ธ EXAMPLES ๐ธ
Trace synchronous file reads and writes slower than 10 ms:
# nfsslower
Trace slower than 1 ms:
# nfsslower 1
Trace slower than 1 ms, and output just the fields in parsable format (CSV):
# nfsslower -j 1
Trace all file reads and writes (warning: the output will be verbose):
# nfsslower 0
Trace slower than 1 ms, for PID 181 only:
# nfsslower -p 181 1
๐ FIELDS ๐
TIME(s)โ When the I/O completed, in seconds, counted from the first I/O seen โฐCOMMโ The process name ๐งโ๐ปPIDโ The process ID ๐Tโ The type of operation.R== read,W== write,O== open,G== getattr ๐คOFF_KBโ The file offset for the I/O, in Kbytes ๐BYTESโ The size of the I/O, in bytes ๐ฆLAT(ms)โ The latency (duration) of the I/O. It's measured from when VFS issued it to the filesystem, until it completed. This time includes RPC latency, network latency, cache lookup, remote fileserver processing latency, and so on. It's a more accurate measure of the latency apps actually suffer when doing NFS read/write calls to a fileserver ๐ฏFILENAMEโ A cached kernel file name (it comes fromdentry->d_name.name) ๐ENDTIME_usโ The completion timestamp, in microseconds (-jonly) ๐OFFSET_bโ The file offset, in bytes (-jonly) ๐งฎLATENCY_usโ The latency (duration) of the I/O, in microseconds (-jonly) โก
๐ซง OVERHEAD ๐ซง
Heads up, this adds low-overhead instrumentation to NFS operations, including reads and writes from the file system cache ๐ Reads, writes, and especially getattrs can be super frequent (depending on the workload, e.g. 1M/sec). At that point, the overhead of this tool can start to get significant, even if it prints no "slower" events at all ๐ฌ Measure and quantify before you use it. If this keeps being a problem, consider switching to a tool that only prints in-kernel summaries. This tool has been tested with NFSv3 & NFSv4, but it might work with NFSv{1,2}, since it traces the generic functions from nfs_file_operations.
Note: this tool's overhead should be lower than fileslower(8), because it only targets NFS functions and not all the file read/write paths ๐
๐ SOURCE ๐
This is from bcc ๐
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion nfsslower_examples.txt file. It has example usage, output, and commentary for this tool ๐
๐ป OS ๐ป
Linux ๐ง
๐ง STABILITY ๐ง
Unstable, it's still in development ๐ ๏ธ
๐ฉโ๐ป AUTHOR ๐ฉโ๐ป
Samuel Nair ๐ซถ
๐ SEE ALSO ๐
biosnoop(8), funccount(8), fileslower(8) โจ
Bestie, that's the whole page ๐ This one is from the USER COMMANDS section, last dated 2017-09-01, so go show your nfsslower(8) skills ๐๐ฆ๐
๐ฆ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 ยท Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 ยท Apache-2.0
- ubuntu jammy: bpfcc-tools 0.18.0+ds-2 ยท Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 ยท Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 ยท Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 ยท Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 ยท Apache-2.0
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms