2

I would like to limit the number of CPU cores that a specific user can use at any single moment. How would I do this on Linux?

1

1 Answer 1

0

From what i know, you cannot do that other than using docker as virtual environment and limiting entire container to selected cores. Example:

docker run --cpuset-cpus="0"

For most of the time you should not be forced to use such solution. If one of the users causes problems use /etc/security/limits.conf adding entry:

username    -       priority        19

That should make all of user's processes run with priority 19 (lowest) and thou even when consuming much of CPU it should not interfere with other programs on the machine.

Also, if it's a matter of single process (not user), then you can use nice or cpulimit / cgroups

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.