1cachestat(8) System Manager's Manual cachestat(8)
2
3
4
6 cachestat - Statistics for linux page cache hit/miss ratios. Uses Linux
7 eBPF/bcc.
8
10 cachestat [-T] [interval [count]]
11
13 This traces four kernel functions and prints per-second summaries. This
14 can be useful for general workload characterization, and looking for
15 patterns in operation usage over time.
16
17 This works by tracing kernel page cache functions using dynamic trac‐
18 ing, and will need updating to match any changes to these functions.
19 Edit the script to customize which functions are traced.
20
21 Since this uses BPF, only the root user can use this tool.
22
24 CONFIG_BPF and bcc.
25
27 Print summaries every second:
28 # cachestat
29
30 Print summaries every second with timestamp:
31 # cachestat -T
32
33 Print output every five seconds, three times:
34 # cachestat 5 3
35
36 Print output with timestamp every five seconds, three times:
37 # cachestat -T 5 3
38
40 TIME Timestamp.
41
42 HITS Number of page cache hits.
43
44 MISSES Number of page cache misses.
45
46 DIRTIES
47 Number of dirty pages added to the page cache.
48
49 HITRATIO
50 The hit ratio as a percentage.
51
52 READ_HIT%
53 Read hit percent of page cache usage.
54
55 WRITE_HIT%
56 Write hit percent of page cache usage.
57
58 BUFFERS_MB
59 Buffers size taken from /proc/meminfo.
60
61 CACHED_MB
62 Cached amount of data in current page cache taken from
63 /proc/meminfo.
64
66 This traces various kernel page cache functions and maintains in-kernel
67 counts, which are asynchronously copied to user-space. While the rate
68 of operations can be very high (>1G/sec) we can have up to 34% over‐
69 head, this is still a relatively efficient way to trace these events,
70 and so the overhead is expected to be small for normal workloads. Mea‐
71 sure in a test environment.
72
74 This is from bcc.
75
76 https://github.com/iovisor/bcc
77
78 Also look in the bcc distribution for a companion _examples.txt file
79 containing example usage, output, and commentary for this tool.
80
82 Linux
83
85 Unstable - in development.
86
88 Allan McAleavy
89
91 https://github.com/brendangregg/perf-tools/blob/master/fs/cachestat
92
93
94
95USER COMMANDS 2016-01-30 cachestat(8)