biolatpcts(8)

πŸ“¦ version 0.36.1, in alpine 3.24, nixpkgs unstable, opensuse-leap 16.0

✨ 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, DEVNAME or MAJ: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 πŸŒˆπŸ’–