Search code examples
gitubuntuprocesskilluserdel

Nearly all cpu time usage of md command


My ubuntu server 17.10 has been running normally. But today I find that the md command of git user occupies nearly all the cpu time somehow. In my first try, I want to kill the process of md command, so I run:

sudo kill -9 <process_id>

But after I kill the process of md, a new process of md occurs at once.

I doubt that the cause of the problem might be the git user, so I deleted user git by force:

sudo userdel git -f

The user git was deleted successfully but the md command remains, and the user becomes 1082 instead of git. Then I doubt that another reason might be the git command, so I remove the git:

sudo apt -y remove git

But the 1012 user and the md command remains. The output of top is here. And there isn't an md or madam command installed on my ubuntu server:

root@amax:~# md
-bash: md: command not found
root@amax:/# madam
-bash: madam: command not found

What is the strangest is that when I add the user git again, the owner of the md command becomes git again! This is the new output of top. There must be some links between git and md but I can't figure it out. So what could the reason be? How to kill the md command permanently? Thank you!


Solution

  • After consistent trying, finally I find a way to solve the problem:

    sudo apt -y install cpulimit
    sudo cpulimit -l <percentage of cpu limit> -p <process id>
    

    The tool cpulimit can limit the percentage of cpu usage of a specified process.