例1:找出前当系统中,CPU负载过高的服务器? 服务器1: load average: 0.15, 0.08, 0.01 1核 服务器2: load average: 4.15, 6.08, 6.01 1核 服务器3: load average: 10.15, 10.08, 10.01 4核
答案是:服务器2,单核心,1分钟的系统平均负载不要超过3
如果服务器的CPU为1核心,则load average中的数字 >=3 负载过高,如果服务器的CPU为4核心,则load average中的数字 >=12 负载过高。
找出占用swap分区最多的进程
for i in $(cd /proc;ls | grep “^[0-9]” | awk ‘$0>100’); do awk ‘/Swap:/{a=a+$2}END{print ‘”$i”‘,a/1024″M”}’ /proc/$i/smaps;done| sort -k2nr | head ps aux | grep ${pid}
其他