本站文章总数为:165
Search Posts

linux 使用hcache查看buff/cache详细占用情况

内容纲要

 

编译安装需要有go语言环境

hcache needs go version > 1.12 for go mod

git clone https://github.com/silenceshell/hcache.git
cd hcache
make build
sudo cp hcache /usr/local/bin/ 

懒的安go我使用github上作者直接编译成功的bin文件
系统环境:
下载地址1:https://silenceshell-1255345740.cos.ap-shanghai.myqcloud.com/hcache
下载地址2:https://wws.lanzouy.com/iEjOk06zvomj
下载地址3:https://pan.baidu.com/s/1s-dj7kBugtXXLYjZsZjyrA?pwd=1s5u 提取码: 1s5u 
上传到/bin/目录
授权执行权限 chmod +x /bin/hcache
使用示例
[root@s18 ~]# hcache --top 10
+---------------------------------------------------------------------------------------+----------------+------------+-----------+---------+
| Name                                                                                  | Size (bytes)   | Pages      | Cached    | Percent |
|---------------------------------------------------------------------------------------+----------------+------------+-----------+---------|
| /usr/bin/clickhouse                                                                   | 150439096      | 36729      | 10668     | 029.045 |
| /usr/local/jdk1.8/jre/lib/amd64/server/libjvm.so                                      | 17109464       | 4178       | 2325      | 055.649 |
| /run/log/journal/da6c8ad792524b1eb98d2e26ffdda17e/system.journal                      | 8388608        | 2048       | 2009      | 098.096 |
| /usr/local/flink/lib/flink-dist_2.11-1.12.2.jar                                       | 114224188      | 27887      | 1070      | 003.837 |
| /usr/lib/locale/locale-archive                                                        | 106075056      | 25898      | 1029      | 003.973 |
| /gldata1/bi_data/kafka/kafka_log/op_log_combatChange-0/00000000000014700428.timeindex | 10485756       | 2560       | 1024      | 040.000 |
| /gldata1/bi_data/kafka/kafka_log/__consumer_offsets-3/00000000000000000000.timeindex  | 10485756       | 2560       | 1024      | 040.000 |
| /gldata1/bi_data/kafka/kafka_log/op_log_bossElite-0/00000000000000000000.timeindex    | 10485756       | 2560       | 1024      | 040.000 |
| /gldata1/bi_data/kafka/kafka_log/op_log_cost-0/00000000000017105013.timeindex         | 10485756       | 2560       | 1024      | 040.000 |
| /gldata1/bi_data/kafka/kafka_log/op_log_gain-0/00000000000050655064.timeindex         | 10485756       | 2560       | 1024      | 040.000 |
+---------------------------------------------------------------------------------------+----------------+------------+-----------+---------+
[root@s18 ~]# hcache --top 3  --bname
+----------------+----------------+------------+-----------+---------+
| Name           | Size (bytes)   | Pages      | Cached    | Percent |
|----------------+----------------+------------+-----------+---------|
| clickhouse     | 150439096      | 36729      | 10668     | 029.045 |
| libjvm.so      | 17109464       | 4178       | 2325      | 055.649 |
| system.journal | 8388608        | 2048       | 2009      | 098.096 |
+----------------+----------------+------------+-----------+---------+

官方usage

hcache <-json <-pps>|-terse|-default> <-nohdr> <-bname> file file file
 -json output will be JSON
   -pps include the per-page information in the output (can be huge!)
 -terse print terse machine-parseable output
 -default print ascii tables
 -histo print a histogram using unicode block characters
 -nohdr don't print the column header in terse or default format
 -bname use basename(file) in the output (use for long paths)
 -plain return data with no box characters
 -unicode return data with unicode box characters
 -pid int show all open maps for the given pid
 -top int show top x cached files

官方github地址:https://silenceshell-1255345740.cos.ap-shanghai.myqcloud.com/hcache

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注