| .TH cachetop 8 "2016-01-30" "USER COMMANDS" |
| .SH NAME |
| cachetop \- Statistics for linux page cache hit/miss ratios per processes. Uses Linux eBPF/bcc. |
| .SH SYNOPSIS |
| .B cachetop [\-p PID] |
| [interval] |
| .SH DESCRIPTION |
| This traces four kernel functions and prints per-processes summaries every |
| \fBinterval\fR seconds. This can be useful for processes workload characterization, |
| and looking for patterns in operation usage over time. It provides a \fBtop\fR-like interface |
| which by default sorts by \fBHITS\fR in ascending order. |
| |
| This works by tracing kernel page cache functions using dynamic tracing, and will |
| need updating to match any changes to these functions. Edit the script to |
| customize which functions are traced. |
| |
| Since this uses BPF, only the root user can use this tool. |
| .SH OPTIONS |
| .TP |
| \-p PID |
| Trace this PID only. |
| .SH KEYBINDINGS |
| The following keybindings can be used to control the output of \fBcachetop\fR. |
| .TP |
| .B < |
| Use the previous column for sorting. |
| .TP |
| .B > |
| Use the next column for sorting. |
| .TP |
| .B r |
| Toggle sorting order (default ascending). |
| .TP |
| .B q |
| Quit cachetop. |
| .SH REQUIREMENTS |
| CONFIG_BPF and bcc. |
| .SH EXAMPLES |
| .TP |
| Update summaries every five second: |
| # |
| .B cachetop |
| .TP |
| Print summaries each second: |
| # |
| .B cachetop 1 |
| .SH FIELDS |
| .TP |
| PID |
| Process ID of the process causing the cache activity. |
| .TP |
| UID |
| User ID of the process causing the cache activity. |
| .TP |
| CMD |
| Name of the process. |
| .TP |
| HITS |
| Number of page cache hits. |
| .TP |
| MISSES |
| Number of page cache misses. |
| .TP |
| DIRTIES |
| Number of dirty pages added to the page cache. |
| .TP |
| READ_HIT% |
| Read hit percent of page cache usage. |
| .TP |
| WRITE_HIT% |
| Write hit percent of page cache usage. |
| .TP |
| BUFFERS_MB |
| Buffers size taken from /proc/meminfo. |
| .TP |
| CACHED_MB |
| Cached amount of data in current page cache taken from /proc/meminfo. |
| .SH OVERHEAD |
| This traces various kernel page cache functions and maintains in-kernel counts, which |
| are asynchronously copied to user-space. While the rate of operations can |
| be very high (>1G/sec) we can have up to 34% overhead, this is still a relatively efficient way to trace |
| these events, and so the overhead is expected to be small for normal workloads. |
| Measure in a test environment. |
| .SH SOURCE |
| This is from bcc. |
| .IP |
| https://github.com/iovisor/bcc |
| .PP |
| Also look in the bcc distribution for a companion _examples.txt file containing |
| example usage, output, and commentary for this tool. |
| .SH OS |
| Linux |
| .SH STABILITY |
| Unstable - in development. |
| .SH AUTHOR |
| Emmanuel Bretelle, Rocky Xing |
| .SH SEE ALSO |
| cachestat (8) |