“Linux 缓存变慢”通常不是指缓存本身变慢,而是系统使用缓存后整体性能下降或命中率变低。下面按常见原因 → 表现 → 排查/解决来说明。
free -h 中 available 很小si/so(swap)不为 0free -h
vmstat 1
cat /proc/meminfo
sysctl vm.swappiness=10
cache 很高但 IO 仍高hit ratio 低sar -B 1
cat /proc/vmstat | grep pg
direct IO 或 nocache# 示例(需内核支持)
echo 1 > /proc/sys/vm/drop_caches # 仅调试
iostat 中 %util 接近 100%iostat -x 1
cat /sys/block/sda/queue/scheduler
mount -o remount,noatime /data
numactl --hardware
numastat
vm.dirty_ratio
vm.dirty_background_ratio
vm.vfs_cache_pressure
实际上可能是:
free -h
vmstat 1
iostat -x 1
sar -B 1
dmesg | tail
如果你能补充:
我可以给你更精确的定位方案。