Cache 大小查看




查看文件缓存的工具
pcstat 命令


hcache 命令

linux-ftools 工具

[root@sfx110008 ~]# cat ~/memory/list_pgf.sh
#!/bin/bash
#Author: Shanker
#Time: 2016/06/08
#set -e
#set -u
#you have to install linux-fincore
if [ ! -f usr/local/bin/linux-fincore ]
then
echo "You haven't installed linux-fincore yet"
exit
fi
#find the top 10 processs' cache file
ps -e -o pid,rss|sort -nk2 -r|head -50 |awk '{print $1}'>/tmp/cache.pids
#find all the processs' cache file
#ps -e -o pid>/tmp/cache.pids
if [ -f tmp/cache.files ]
then
echo "the cache.files is exist, removing now "
rm -f tmp/cache.files
fi
while read line
do
lsof -p $line 2>/dev/null|awk '{print $9}' >>/tmp/cache.files
done </tmp/cache.pids
if [ -f tmp/cache.fincore ]
then
echo "the cache.fincore is exist, removing now"
rm -f tmp/cache.fincore
fi
for i in `cat tmp/cache.files | sort |uniq `
do
if [ -f $i ]
then
echo $i >>/tmp/cache.fincore
fi
done
linux-fincore --only-cached -C 1048576 -s `cat /tmp/cache.fincore`
rm -f /tmp/cache.{pids,files,fincore}
复制





PostgreSQL数据库表文件缓存状况


pgfincore 扩展




文章转载自数据库技术闲谈,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
总内存128G,cache78G,shared499M,使用list_pgf.sh脚本直接结果内存为3G,不知是什么原因
11月前

评论
相关阅读
【专家有话说第五期】在不同年龄段,DBA应该怎样规划自己的职业发展?
墨天轮编辑部
1328次阅读
2025-03-13 11:40:53
2月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
470次阅读
2025-03-13 14:38:19
AI的优化能力,取决于你问问题的能力!
潇湘秦
445次阅读
2025-03-11 11:18:22
优炫数据库成功应用于国家电投集团青海海南州新能源电厂!
优炫软件
347次阅读
2025-03-21 10:34:08
国产化+性能王炸!这套国产方案让 3.5T 数据 5 小时“无感搬家”
YMatrix
288次阅读
2025-03-13 09:51:26
征文大赛 |「码」上数据库—— KWDB 2025 创作者计划启动
KaiwuDB
244次阅读
2025-04-01 20:42:12
一键装库脚本3分钟极速部署,传统耗时砍掉95%!
IT邦德
244次阅读
2025-03-10 07:58:44
GoldenDB数据库社区正式上线!期待与您共享新知
GoldenDB分布式数据库
242次阅读
2025-03-12 14:06:39
Navicat 17.2 正式发布 | AI 助手、支持 Snowflake...超多新功能等你解锁
Navicat
209次阅读
2025-03-14 14:13:33
套壳论
梧桐
201次阅读
2025-03-09 10:58:17