iolatency(8) | System Manager's Manual | iolatency(8) |
iolatency - summarize block device I/O latency as a histogram. Uses Linux ftrace.
iolatency [-hQT] [-d device] [-i iotype] [interval [count]]
This shows the distribution of latency, allowing modes and latency outliers to be identified and studied. For more details of block device I/O, use iosnoop(8).
This is a proof of concept tool using ftrace, and involves user space processing and related overheads. See the OVERHEAD section.
NOTE: Due to the way trace buffers are switched per interval, there is the possibility of losing a small number of I/O (usually less than 1%). The summary therefore shows the general distribution, but may be slightly incomplete. If 100% of I/O must be studied, use iosnoop(8) and post-process. Also note that I/O may be missed when the trace buffer is full: see the interval section in OPTIONS.
Since this uses ftrace, only the root user can use this tool.
FTRACE CONFIG, and the tracepoints block:block_rq_issue and block:block_rq_complete, which you may already have enabled and available on recent Linux kernels. And awk.
During the interval, trace output will be buffered in-kernel, which is then read and processed for the summary. This buffer has a fixed size per-CPU (see /sys/kernel/debug/tracing/buffer_size_kb). If you think events are missing, try increasing that size (the bufsize_kb setting in iolatency). With the default setting (4 Mbytes), I'd expect this to happen around 50k I/O per summary.
Block device I/O issue and completion events are traced and buffered in-kernel, then processed and summarized in user space. There may be measurable overhead with this approach, relative to the block device IOPS.
The overhead may be acceptable in many situations. If it isn't, this tool can be reimplemented in C, or using a different tracer (eg, perf_events, SystemTap, ktap.)
This is from the perf-tools collection.
Also look under the examples directory for a text file containing example usage, output, and commentary for this tool.
Linux
Unstable - in development.
Brendan Gregg
2014-07-12 | USER COMMANDS |