Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to learn how cgroup works on Ubuntu and seems that cgroup doesn't work in Ubuntu 13.04. I am using the answer to this question How to set cpu limit for given process permanently. Cpulimit and nice don't work

These are what I've done:

  1. Installed cgroup:

    sudo apt-get install cgroup-bin
  2. reboot

  3. Make a cgroup for your user (the owner of the process):

    sudo cgcreate -a ipeacocks -g cpu:ipeacocks
  4. Ran the command:

    echo 100 > /sys/fs/cgroup/cpu/ipeacocks/cpu.shares
  5. And the command:

    cgexec -g cpu:ipeacocks stress --cpu 4

and output:

cgroup change of group failed

Why? What I am doing wrong?

share|improve this question
up vote 10 down vote accepted

You need to be the owner of the tasks file as well so you have permission to write a pid to it. To do that, Use -t, e.g.,

sudo cgcreate -a ipeacocks:ipeacocks -t ipeacocks:ipeacocks -g cpu:ipeacocks
share|improve this answer
yes, that was it. A pity I cannot mark at solved. @ipeacocks, would you? – Rmano Nov 21 '14 at 18:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.