fileslower(8)
β¨ NAME β¨
okay so the manual page for fileslower(8) (System Manager's Manual, bestie π
) is basically here to tell you: fileslower is a tool that traces slow synchronous file reads and writes. π¦
π SYNOPSIS π
fileslower [-h] [-p PID] [-a] [min_ms]
πΈ DESCRIPTION πΈ
okay this one is so good, no cap. It uses kernel dynamic tracing on synchronous reads and writes at the VFS interface, so it can catch slow file reads and writes on any file system. β¨
This version traces __vfs_read() and __vfs_write(), and it only shows synchronous I/O (the path through new_sync_read() and new_sync_write()) plus I/O that has filenames. So you're getting a view of just two file system request types: file reads and writes. There are typically a bunch of others too: asynchronous I/O, directory operations, file handle operations, file open()s, fflush(), etc. π
π WARNING: See the OVERHEAD section. Seriously, read it before you do anything wild.
By default, the minimum millisecond threshold is 10. π
Since this works by tracing various kernel __vfs_*() functions using dynamic tracing, it'll need updating to match any changes to those functions. A future version should switch to using FS tracepoints instead. π§
Since this uses BPF, only the root user can use this tool. π
π REQUIREMENTS π
CONFIG_BPF and bcc. that's it, that's the list. π
β OPTIONS β
-p PIDβ trace this PID only. main character energy π-aβ include non-regular file types in the output (sockets, FIFOs, etc). π¦min_msβ the minimum I/O latency (duration) to trace, in milliseconds. It defaults to 10 ms. π
π EXAMPLES π
Trace synchronous file reads and writes slower than 10 ms:
# fileslower
Trace slower than 1 ms:
# fileslower 1
Trace slower than 1 ms, for PID 181 only:
# fileslower -p 181 1
π FIELDS π
Here's what the columns mean, bestie:
TIME(s)β the time of I/O completion, measured from the first I/O it saw, in seconds. β°COMMβ the process name. π§PIDβ the process ID. πDβ the direction of the I/O.R== read,W== write. πBYTESβ the size of the I/O, in bytes. π«ΆLAT(ms)β the latency (duration) of the I/O, measured from when the application issued it to VFS until it completed. This time includes block device I/O, file system CPU cycles, file system locks, run queue latency, etc. It's a more accurate measure of the latency an application actually suffers when doing file system I/O, compared to measuring down at the block device interface. it's giving accuracy π₯FILENAMEβ a cached kernel file name (comes fromdentry->d_name.name). π
β οΈ OVERHEAD β οΈ
π Depending on how often the application reads and writes, the overhead can get severe, in the worst case slowing applications by 2x. In the best case, the overhead is negligible. Hopefully for real world workloads the overhead is often at the lower end of the spectrum, so test before use.
The reason for high overhead is that this traces VFS reads and writes, which includes FS cache reads and writes, and it can exceed one million events per second if the application is I/O heavy. The instrumentation is extremely lightweight and uses in-kernel eBPF maps for efficient timing and filtering, but multiply that cost by one million events per second and it becomes a million times worse. π
You can get an idea of the possible cost by just counting the instrumented events using the bcc funccount tool, eg:
# ./funccount.py -i 1 -r '^__vfs_(read|write)$'
This also costs overhead, but it's somewhat less than fileslower. πΈ
If the overhead is prohibitive for your workload, I'd recommend moving down-stack a little from VFS into the file system functions (ext4, xfs, etc). Look for updates to bcc for specific file system tools that do this. The advantage of a per-file-system approach is that we can trace post-cache, which greatly reduces events and overhead. The disadvantage is needing custom tracing approaches for each different file system, whereas VFS is generic. π§
π SOURCE π
This is from bcc:
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. π
π» OS π»
Linux π§
π§ͺ STABILITY π§ͺ
Unstable - in development. π
π©βπ» AUTHOR π©βπ»
Brendan Gregg π«Ά
π SEE ALSO π
biosnoop(8), funccount(8) β¨
bye bestie, you're officially a fileslower expert now π¦π this page came from the USER COMMANDS section, last updated 2016-02-07, and it's all from fileslower(8) ππ
π¦ where this page comes from
- centos-stream 10: bcc-tools 0.36.1-1.el10 Β· Apache-2.0
- centos-stream 9: bcc-tools 0.36.1-1.el9 Β· ASL 2.0
- fedora 43: bcc-tools 0.35.0-2.fc43 Β· Apache-2.0
- fedora 44: bcc-tools 0.35.0-5.fc44 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms