在我们经常接触运维的过程中,经常会遇到僵尸进程的问题,有些会自动回收掉,有些则不能,如果数理过多,会对服务器产生大的影响
如何查到僵尸进程
top cmd
top - 09:41:16 up 157 days, 19:44, 8 users, load average: 19.28, 26.37, 37.92
Tasks: 781 total, 17 running, 758 sleeping, 0 stopped, 6 zombie
Cpu(s): 49.3%us, 14.6%sy, 0.0%ni, 35.6%id, 0.3%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 48270M total, 36361M used, 11909M free, 2084M buffers
Swap: 32773M total, 0M used, 32773M free, 24173M cached
Not valid
存在6个僵尸进程
找到僵尸进程
linux-wawp:~ # ps -ef |grep defunc
mos5200 3675 3663 0 Oct08 ? 00:00:00 [sh] <defunct>
mos5200 3862 3852 0 Oct08 ? 00:00:00 [sh] <defunct>
mos5200 3902 3822 0 Oct08 ? 00:00:00 [sh] <defunct>
mos5200 3917 3899 0 Oct08 ? 00:00:00 [sh] <defunct>
mos5200 29217 29212 0 Oct15 ? 00:00:00 [sh] <defunct>
mos5200 32099 27819 0 09:43 pts/4 00:00:00 [sort] <defunct>
mos5200 32100 27819 0 09:43 pts/4 00:00:00 [head] <defunct>
root 32159 24787 0 09:43 pts/6 00:00:00 grep defunc
mos5200 32459 32432 0 Oct04 ? 00:00:00 [sh] <defunct>
杀死僵尸进程
su - 到root用户下
kill -9 3675 3663 杀死一个僵尸进程
如果有很多的话