LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   cgroups (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/cgroups-884956/)

spokz 06-07-2011 04:11 AM

cgroups
 
Hi.

I managed to create /cgroup/jail group, then I added (not through 'echo' command because permission denied error shows - maybe this is the problem?) chosen PID to tasks file and then '102' to cpu.shares (as 102 is 10% of cpu).

This process still uses more than 10% of cpu.
Anybody knows how to have it works fine?

wpeckham 06-07-2011 10:50 AM

cgroups
 
My understanding, not verified, but...

I think that is a little deceptive.
You see, you are not LIMITING it to 10%, you are GUARENTEEING it 10%!
The system can give it MORE as long as there is more to give, but will always try to ensure that it has AT LEAST 10% available to it.

spokz 06-07-2011 02:49 PM

Well, I still think 102 in cpu.shares limit cpu power to 10% of physical cpu. But probably if other procesess don't use whole cpu power, even limited process can use more than 10%. Only when physical cpu usage reach 100%, cgroup limits included procesess.

I'm going to test this in virtual environment tomorrow and post the result.

spokz 06-08-2011 05:48 AM

My assumptions were right I guess. When physical CPU is 100% used, chosen procesess in cgroup are limited and can use only as much cpu power as I give them in cpu.shares.
But on the other hand I can say cgroups don't work too precisely (from what I saw in 'top').


All times are GMT -5. The time now is 11:25 AM.