程服务器负载异常处理

1、内存告警

[root@localhost eversec]# free -m
             total       used       free     shared    buffers     cached
Mem:         32072      31873        199          0        129         90
-/+ buffers/cache:      31653        419
Swap:        16103       3519      12584

2、查看负载:

[root@localhost eversec]# uptime
15:00:46 up 89 days, 54 min,  1 user,  load average: 4880.43, 4872.78, 4852.09

3、top:

[root@localhost eversec]# top

top - 15:00:46 up 89 days, 54 min,  1 user,  load average: 4880.43, 4872.78, 4852.09
Tasks: 15719 total,   1 running, 15717 sleeping,   1 stopped,   0 zombie
Cpu(s):  0.2%us,  0.4%sy,  0.0%ni, 95.4%id,  4.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  32842712k total, 31825648k used,  1017064k free,   138396k buffers
Swap: 16490488k total,  2988636k used, 13501852k free,   107888k cached

4、pstree

[root@localhost eversec]# pstree
init─┬─auditd───{auditd}
     ├─crond───5111*[crond───sendmail───postdrop]
     ├─master─┬─3*[cleanup]
     │        ├─pickup
     │        └─qmgr
     ├─6*[mingetty]
     ├─newiup───61*[{newiup}]
     ├─rsyslogd───3*[{rsyslogd}]
     ├─sshd───sshd───sshd───enable───su───bash─┬─pstree
     │                                         └─vmstat
     └─udevd───2*[udevd]

 5、df -i 查看为inodes空间满

 6、关闭sendmail进程

 7、清除占用inodes的垃圾文件,服务器恢复正常

# 1、确定是某个目录下面:
for i in /*; do echo -ne $i"	"; find $i | wc -l; done

# 2、若是/var/spool:
for i in /var/spool/*; do echo $i; find $i | wc -l; done

# 3、找到相应目录后,进行删除操作:
ls | xargs -n 10 rm -rf
原文地址:https://www.cnblogs.com/pzzning/p/8609884.html