How to limit a user’s CPU resources in Linux Systems
Posted on In QAWhen you use a server with other users, you might want to limit other users’ CPU resources for some specific aims.
Cgroup has lots of parameters we can use to control computer resources. For CPU resources, you can tune cpu.shares
parameter to limit users’ CPU resources.
To be more precise, change directory to /sys/fs/cgroup/cpu/user
and choose the user you want to control. And then, you will see cpu.shares
parameter under the directory. You might want to read [1] for more details about how to tune it.