I have some processes running on Debian that I want to limit cpu of it usage in the "soft" manner. For example, if it eats more than 70% of a single core for more than 15 minutes, the CPU should be limited to 30%. If it uses only 30-40% of a single core, it is free to run.

Currently, I have to manage it by logging into the server and do the work manually. Therefore, I am thinking to automate this tasks by some script/software and crontab. Any suggestions are highly appreciated.

1 Answer 1


You can use cpulimit command. It works like nice, but sets a limit instead of a niceness.

You did not say what OS you are using. On Debian (and derivatives) you can install with apt install cpulimit.

If is not good enough, then you will need process namespaces.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .