biolatpcts(8)
β¨ NAME β¨
biolatpcts π is the tool that monitors the IO latency distribution of a block device. It's the biolatpcts(8) manual page, so you know it's serious π
π SYNOPSIS π
biolatpcts [-h] [-i INTERVAL] [-w which] [-p PCT,...] [-j] [-v] DEV
π¦ DESCRIPTION π¦
okay so bestie, biolatpcts watches block device I/O (aka disk I/O) on the device you point it at π and then works out the completion latency percentiles for each IO type, over and over, while you watch. it's giving data scientist, ngl π§
here's what it looks like in action:
# biolatpcts /dev/nvme0n1
nvme0n1 p1 p5 p10 p16 p25 p50 p75 p84 p90 p95
p99 p100
read 95us 175us 305us 515us 895us 985us 995us 1.5ms 2.5ms 3.5ms
4.5ms 10ms
write 5us 5us 5us 15us 25us 135us 765us 855us 885us 895us
965us 1.5ms
discard 5us 5us 5us 5us 135us 145us 165us 205us 385us 875us
1.5ms 2.5ms
flush 5us 5us 5us 5us 5us 5us 5us 5us 5us 1.5ms
4.5ms 5.5ms
[...]
by default it prints a set of pre-set latency percentiles in a neat table every three seconds πΈ you can change how often with the -i option.
the latency is measured from issue to the device until completion π«Ά if you want to start the clock somewhere else, use the -w option.
you can ask for any number of percentiles with the -p option β¨ whatever string you type is used exactly as typed in the output, so machines can parse it without any drama.
the -j option turns on json output, and each interval gets printed on a single line π
quick tea: this tool works by tracing blk_account_io_done() with kprobe and dropping the completion latencies into percpu arrays π₯ it might need updating if that function changes, so keep that in mind, bestie.
β οΈ Since this uses BPF, only the root user can use this tool. no sneaking in as a normal user π
π REQUIREMENTS π
You'll need CONFIG_BPF, CONFIG_KPROBES and bcc. no cap, these are non-negotiable π
π OPTIONS π
-hβ prints the usage message π-i INTERVAL,--interval INTERVALβ how often the report shows up β° (default:3)-w {from-rq-alloc,after-rq-alloc,on-device},--which {from-rq-alloc,after-rq-alloc,on-device}β picks which latency gets measured π― (default:on-device)-p PCT,...,--pcts PCT,...β the percentiles you want calculated π (default:1,5,10,16,25,50,75,84,90,95,99,100)-j,--jsonβ outputs in json π§Ύ-v,--verboseβ turns on debug output πDEVβ the target block device π it can be/dev/DEVNAME,DEVNAMEorMAJ:MIN
π EXAMPLES π
Print sda's I/O latency percentiles every second π«§
# biolatpcts -i 1 sda
Print nvme0n1's all-9 I/O latency percentiles in json every second. the "all-9" squad is β¨ iconic β¨
# biolatpcts -p 99,99.9,99.99,99.999 -j -i 1 /dev/nvme0n1
π§ OVERHEAD π§
not gonna lie, this one is actually chill π«Ά it traces kernel functions and keeps per-cpu latency buckets in the kernel, which then get copied to user-space asynchronously. this method is very efficient, and for most storage I/O rates the overhead should be negligible. but if you have an extremely high IOPS storage device, test and quantify the overhead before you use it π
π SOURCE π
this is from bcc π
https://github.com/iovisor/bcc
also check the bcc distribution for a companion _examples.txt file with example usage, output, and commentary for this tool π
πΈ OS πΈ
Linux π§
π§ͺ STABILITY π§ͺ
Unstable, it's still in development π§
π AUTHOR π
Tejun Heo β¨
π¦ SEE ALSO π¦
biolatency(8), biosnoop(8) π
Bestie, that's the whole page π biolatpcts(8) from the USER COMMANDS section, dated 2020-04-17, with the bcc source vibes π Stay curious and keep your percentiles spicy ππ
π¦ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms