cachetop(8)

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

πŸ’– cachetop(8) πŸ’–

okay so this is the manual page for cachetop(8), and bestie, it is so good. πŸ¦‹ Let's go through it together.

✨ NAME ✨

cachetop - Statistics for linux page cache hit/miss ratios per processes. Uses Linux eBPF/bcc. πŸ”₯

πŸŽ€ SYNOPSIS πŸŽ€

cachetop [-p PID] [interval]

🌸 DESCRIPTION 🌸

okay so this thing traces four kernel functions and prints per-process summaries every interval seconds πŸ“Š. It's giving useful for workload characterization, and for spotting patterns in operation usage over time. ngl it's a top-like interface, and by default it sorts by HITS in ascending order πŸ’….

It works by tracing kernel page cache functions using dynamic tracing, so it will need updating to match any changes to those functions. If you want to customize which functions get traced, edit the script 🧚.

🚨 Since this uses BPF, only the root user can use this tool. No cap, don't try it as a regular user πŸ™ˆ.

πŸ’œ OPTIONS πŸ’œ

  • -p PID β€” trace this PID only 🎯.

⭐ KEYBINDINGS ⭐

The following keybindings control the output of cachetop, so use them wisely πŸ‘‘.

  • < β€” use the previous column for sorting ⬅️.
  • > β€” use the next column for sorting ➑️.
  • r β€” toggle sorting order (default ascending) πŸ”„.
  • q β€” quit cachetop πŸ‘‹.

πŸ“ REQUIREMENTS πŸ“

You need CONFIG_BPF and bcc. That's it, that's the list 🧚.

🌈 EXAMPLES 🌈

Update summaries every five second:

# cachetop

Print summaries each second:

# cachetop 1

πŸ¦‹ FIELDS πŸ¦‹

  • PID β€” process ID of the process causing the cache activity πŸ†”.
  • UID β€” user ID of the process causing the cache activity πŸ™‹.
  • CMD β€” name of the process πŸ’».
  • HITS β€” number of page cache hits 🎯.
  • MISSES β€” number of page cache misses πŸ’€.
  • DIRTIES β€” number of dirty pages added to the page cache ✏️.
  • READ_HIT% β€” read hit percent of page cache usage πŸ“–.
  • WRITE_HIT% β€” write hit percent of page cache usage ✍️.
  • BUFFERS_MB β€” buffers size taken from /proc/meminfo 🧺.
  • CACHED_MB β€” cached amount of data in current page cache, taken from /proc/meminfo πŸ“¦.

😭 OVERHEAD 😭

okay real talk, this traces various kernel page cache functions and keeps in-kernel counts, which are asynchronously copied to user-space. The rate of operations can be very high (>1G/sec), and we can have up to 34% overhead. Still, it's a relatively efficient way to trace these events, so the overhead is expected to be small for normal workloads 🫢.

⚠️ Measure in a test environment first, bestie. The overhead can get spicy 🌢️.

🧚 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 πŸ‘‘

Emmanuel Bretelle, Rocky Xing πŸ’–.

πŸ”₯ SEE ALSO πŸ”₯

cachestat (8) ✨.


And that's a wrap, bestie πŸ’…πŸŽ€. This page is from the USER COMMANDS section, last updated 2016-01-30, and it's giving cachetop(8) all the way through 🌈✨.