Linux控制进程CPU使用率

使用cpulimit不用root权限也能控制CPU使用率:https://github.com/opsengine/cpulimit

例如要控制最多使用200%的CPU,也就是两个核:

cpulimit -l 200 -f -- 可执行文件 参数...
       -l, --limit=N
              percentage of CPU allowed from 1 up. Usually 1 - 100, but can be higher on multi-core CPUs. (manda‐
              tory)
       -f, --foreground
              run cpulimit in foreground while waiting for launched process to finish
posted @ 2024-07-15 17:28  寻找繁星  阅读(8)  评论(0编辑  收藏  举报