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?
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