cpulimit-限制CPU速率

CPULimit是一个简单的程序,它可以限制指定进程的CPU百分比。

1、安装依赖

root@localhost:~# apt-get -y install git

2、从GitHUB中克隆源码到本地

root@localhost:~# git clone https://github.com/opsengine/cpulimit.git

3、编译并安装

root@localhost:~# cd cpulimit/src
root@localhost:~/cpulimit/src# make
root@localhost:~/cpulimit/src# cp cpulimit /usr/bin

4、限制指定进程的CPU百分比

下面演示的是将进程号为“11830”的进程的CPU限制在百分之200。

root@localhost:~# nohup cpulimit --pid 11830 --limit 200 &
posted @ 2021-11-05 15:49  RidingWind  阅读(927)  评论(0)    收藏  举报