zfsslower(8)
๐ง zfsslower(8) ๐ง
โจ NAME โจ
okay so the name is zfsslower ๐ and it's basically a tracer for slow ZFS file operations, with per-event details. literally the tool you want when your files are being sus and slow ๐ซถ
๐ SYNOPSIS ๐
zfsslower [-h] [-j] [-p PID] [min_ms]
๐ธ DESCRIPTION ๐ธ
okay bestie, this tool watches the common ZFS file ops: reads, writes, opens, and syncs ๐. It times each one and prints the details for any that go over a threshold. no cap, it's giving detective โจ
WARNING: See the OVERHEAD section. (seriously, read it ๐ญ)
By default the threshold is 10 milliseconds ๐. If you set it to 0, every single event gets printed. that's giving chaos and also a LOT of output, so be warned ๐
This uses kernel dynamic tracing of the ZPL interface (ZFS POSIX Layer) ๐ฅ. Because it hooks into that interface, it'll need updates if the interface ever changes. not me being dramatic, it's just how it works ๐
This is meant for the ZFS on Linux project: http://zfsonlinux.org ๐
And since it runs on BPF, only the root user can use it ๐. sorry, not sorry ๐ซถ
๐ REQUIREMENTS ๐
You'll need CONFIG_BPF and bcc ๐ง (no bcc, no tea)
โจ OPTIONS โจ
-p PIDโ only trace this one PID ๐min_msโ the minimum I/O latency (duration) you want to trace, in milliseconds ๐. It defaults to 10 ms if you don't set it.
๐ฆ EXAMPLES ๐ฆ
Trace synchronous file reads and writes that are slower than 10 ms:
# zfsslower
Trace anything slower than 1 ms:
# zfsslower 1
Trace slower than 1 ms, and print just the fields in parsable format (csv) ๐:
# zfsslower -j 1
Trace all file reads and writes (warning: the output is going to be extremely verbose ๐ญ):
# zfsslower 0
Trace slower than 1 ms, for PID 181 only ๐ฏ:
# zfsslower -p 181 1
๐ฅ FIELDS ๐ฅ
TIME(s)โ when the I/O finished, counted in seconds from the first I/O it saw โฐCOMMโ the process name ๐งโ๐ปPIDโ the process ID ๐ชชTโ the type of operation.Ris read,Wis write,Ois open, andSis fsync ๐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, measured from when VFS issued it to the filesystem until it completed ๐. This includes block device I/O, filesystem CPU cycles, filesystem locks, run queue latency, and so on. It's a more honest measure of what applications actually feel than timing things down at the block device layer, so it's the one to trust ๐ซถ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 โ ๏ธ
okay this section is important, so read it slowly ๐
This adds low-overhead instrumentation to these ZFS operations, including reads and writes from the file system cache. Those reads and writes can be super frequent (it depends on the workload, eg, 1M/sec ๐ณ). At that point, the tool's own overhead can start to get significant, even if it prints zero "slower" events. So measure and quantify before you use it ๐. If it's still a problem, consider switching to a tool that only prints in-kernel summaries ๐ง.
The overhead here should be less than fileslower(8), since this tool only targets ZFS functions and not every file read/write path (which can include socket I/O) ๐ฆ.
๐ SOURCE ๐
This comes from bcc ๐:
https://github.com/iovisor/bcc
There's also a companion _examples.txt file in the bcc distribution with example usage, output, and commentary for this tool ๐. go look, it's lowkey fire.
๐ OS ๐
Linux ๐ง
๐งช STABILITY ๐งช
Unstable (it's still in development) ๐
๐ AUTHOR ๐
Brendan Gregg ๐ซถ
๐ SEE ALSO ๐
biosnoop(8), funccount(8), fileslower(8) ๐
bestie, that's the whole thing ๐ โจ this page is from the USER COMMANDS section, dated 2016-02-11, and the source is bcc ๐ธ. periodt ๐ซถ๐
๐ฆ 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