6

I have set up CPU sets with cset in Ubuntu 12.04, but they are not respected. Processes just use all the CPU they can, no matter what set they are assigned to.

It seems that cpuset is not enabled. How can I enable cpuset?

1
1

Are you open to using other utility cpulimit?

1) Install cpulimit by issuing sudo apt-get install cpulimit

2) Limit the process in question like this (say we want to restrict java to use not more than 30 % of CPU)

cpulimit -e java -l 30
0

you can do that with nice and renice command in the terminal.

for example: sudo renice -n -15 -u username

The options are:

-n=priority from -20 to 20 (where -20 is highest)

-p=process id (found in task manager)

-u=all events user started

Or do you mean something else?

2
  • The original question was how to enable cpuset. Does nice/renice help with enabling cpuset, or does it achieve cpuset functionality, and if so, how? From the current answer, it's not clear what the commands do. Nov 3 '14 at 21:45
  • nice / renice don't limit cpu-usage, they just alter the cpu-priority (niceness) of the process(es). cpuset is quit another fish.
    – Soren A
    Feb 7 '17 at 12:28

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.