cachetop(8)
π 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 πβ¨.
π¦ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 Β· Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 Β· Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 Β· Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 Β· Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms