How to limit a user's CPU resources in Linux Systems

When you use a server with other users, you might want to limit other users' CPU resources for some specific aims.

asked Sep 2 by harryxiyou (4,690 points)

1 Answer

 
Best answer

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.

[1] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-cpu.html

answered Sep 2 by harryxiyou (4,690 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...