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?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Ruben Verborgh
  • 203
  • 2
  • 5

2 Answers2

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
Horizon
  • 281
  • 1
  • 7
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?

Luís de Sousa
  • 13,018
  • 25
  • 77
  • 128
re3el
  • 11
  • 3
  • 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. – Ruben Verborgh Nov 03 '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 07 '17 at 12:28