Gitlab進程出現exe進程一直CPU占用200%
-最近一直報警,gitlab的服務器負載占用率較高,通過top命令查看發(fā)現一個USER名為git的exe進程CPU占用200%,kill掉之后反復出現,應該是子進程,然后查找出父進程:pstree -p|more;殺掉父進程和子進程,過了幾天又出現。
-然后通過pid找到這個進程運行的命令,top后查看pid在/proc/里面,發(fā)現exe進程軟連接到/tmp/tmp.swap,查看服務器發(fā)現swap分區(qū)沒有關閉,先關閉swap分區(qū):swapoff -a;關閉之后然在殺掉,先觀察幾天,如果有問題在更新。
[root@gitlab-jenkins ~]# top #查看pid
[root@gitlab-jenkins ~]# kill -9 pid #殺掉進程
[root@gitlab-jenkins ~]# pstree -p|more #殺不掉查看父進程
[root@gitlab-jenkins ~]# cd /proc/(pid) #通過pid查看運行的內容
[root@gitlab-jenkins ~]# ls
lrwxrwxrwx 1 git git 0 Feb 14 11:18 cwd -> /var/opt/gitlab/gitlab-rails/working #進程所在目錄
lrwxrwxrwx 1 git git 0 Feb 14 11:01 exe -> /opt/gitlab/embedded/bin/ruby #進程類型
[root@gitlab-jenkins ~]# ps -aux |grep -v grep|grep pid #也可以通過命令查看
[root@gitlab-jenkins ~]# swapoff -a #關閉swap分區(qū)