如何kill云主机的高CPU进程

今天云主机的CPU很高,如下:

[root@10-9-15-140 ~]# top
top - 12:25:19 up 1 min,  1 user,  load average: 1.54, 0.49, 0.17
Tasks:  96 total,   1 running,  95 sleeping,   0 stopped,   0 zombie
Cpu(s): 99.2%us,  0.8%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3859680k total,   157936k used,  3701744k free,     9388k buffers
Swap:   524284k total,        0k used,   524284k free,    52116k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                        
 1969 hadoop    20   0 70320 7520    8 S 196.6  0.2   2:30.26 bash64                         
  752 root      20   0     0    0    0 S  0.3  0.0   0:00.01 kauditd                         
 1955 root      20   0 15020 1300 1004 R  0.3  0.0   0:00.09 top                             
    1 root      20   0 19364 1548 1244 S  0.0  0.0   0:00.59 init                            
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd                        
    3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0                     
    4 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0                     
    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 stopper/0                       
    6 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                      
    7 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/1                     
    8 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 stopper/1                       
    9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1                     
   10 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/1                      
   11 root      20   0     0    0    0 S  0.0  0.0   0:00.00 events/0                        
   12 root      20   0     0    0    0 S  0.0  0.0   0:00.00 events/1                        
   13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 events/0                        
   14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 events/1                        
[root@10-9-15-140 ~]# 

解决方法:

查询高CPU进程的父进程,并且去除父进程执行文件的执行权,再把它kill掉。

[root@10-9-15-140 ~]# ps -ef|grep 1969
hadoop    1969  1960 99 12:24 ?        00:02:59 /home/hadoop/.tmp00/bash64 -c /home/hadoop/.tmp00/cfgi
root      3695  1940  0 12:25 pts/0    00:00:00 grep 1969
[root@10-9-15-140 ~]#

高CPU进程1969的副进程是1960,
chmod -x bash64 --把1960的执行文件bash64的执行权去除
kill -9 1960 --把1960kill掉
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值