https://www.codeleading.com/article/56251061422/
github地址:https://github.com/brendangregg/perf-tools/blob/master/fs/cachestat
将上面的github的内容复制,然后写入cachestat文件,并且加上x权限即可;
可以参考这篇文章:https://blog.csdn.net/sinat_28317385/article/details/112971208
使用cachestat
[root@i-ifgwrq7g ~]# ./perf-tools/bin/cachestat
Counting cache functions... Output every 1 seconds.
HITS MISSES DIRTIES RATIO BUFFERS_MB CACHE_MB
232 225 2 50.8% 0 174
428 5 0 98.8% 0 175
433 0 0 100.0% 0 175
2496 872 2 74.1% 0 175
323 5 0 98.5% 0 176
327 2 5 99.4% 0 176
303 148 2 67.2% 0 174
323 5 0 98.5% 0 175
328 0 0 100.0% 0 175
339 194 3 63.6% 0 174
428 5 0 98.8% 0 175
426 0 13 100.0% 0 175
304 148 2 67.3% 0 174
2833 512 0 84.7% 0 177
328 0 0 100.0% 0 177
305 148 2 67.3% 0 174
^C 416 5 0 98.8% 0 175