I operate a Linux system which has a lot of users but sometimes an abuse occurs; where a user might run a single process that uses up more than 80% of the CPU/Memory.
So is there a way to prevent this from happening by limiting the amount of CPU usage a process can use (to 10% for example)? I'm aware of cpulimit
, but it unfortunately applies the limit to the processes I instruct it to limit (e.g single processes). So my question is, how can I apply the limit to all of the running processes and processes that will be run in the future without the need of providing their id/path for example?
cpulimit
in conjunction with your search script. Have a policy and recommend the use ofcpulimit
, then search for over 10% and then limit to 5% (so users are encouraged to usecpulimit
). Also make sure you can detect multiple processes adding up to more that 10% for a single user.cpulimit
is way better than just killing the process since it can be restarted by the user later on (as pointed in one of your comments). Thank you!