Subject: cgroup to allocate CPU resource
From: Nirmal Guhan <vavatutu@gmail.com>
Date: Tue, 15 Jun 2010 14:37:58 -0700
Tue, 15 Jun 2010 14:37:58 -0700
Hi,

Am trying to put a (hard)limit on the CPU util of two of my VPS.
I set
1) VPS 1 :
cpu.rt_period_us to 1000000
cpu.rt_runtime_us to 500000
cpuset.cpus to 1
2) VPS 2:
cpu.rt_period_us to 1000000
cpu.rt_runtime_us to 100000
cpuset.cpus to 1
Basically I want VPS1 to use not more than 50% of CPU and VPS2 not more than
10%. This doesn't seem to work. I can see these values are set correctly
when I cat /dev/cgroup/<VPS> but when I do vtop I always see ~50% from each
of the VPS (Am just executing a C program that goes on an infinite loop in
both the VPS for testing).

Could someone sched some light? Am referring to
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6-Beta/html/Resource_Management_Guide/cpu.htmlfor
the documentation.

Thanks,
Nirmal


Hi,

Am trying to put a (hard)limit on the CPU util of two of my VPS.
I set
1) VPS 1 :
cpu.rt period us to 1000000
cpu.rt runtime us to 500000
cpuset.cpus to 1
2) VPS 2:
cpu.rt period us to 1000000
cpu.rt runtime us to 100000
cpuset.cpus to 1
Basically I want VPS1 to use not more than 50% of CPU and VPS2 not more than 10%. This doesn't seem to work. I can see these values are set correctly when I cat /dev/cgroup/<VPS> but when I do vtop I always see ~50% from each of the VPS (Am just executing a C program that goes on an infinite loop in both the VPS for testing).

Could someone sched some light? Am referring to http://www.redhat.com/docs/en-US/Red Hat Enterprise Linux/6-Beta/html/Resource Management Guide/cpu.html for the documentation.

Thanks,
Nirmal