[Lxc-users] how to use cpuset.shares?

陈竞 cj.magina at gmail.com
Thu Aug 25 04:02:26 UTC 2011


according to my test cpu.shares just points to per cpu time, suppose you
have 3 container, A ,B, C :
A: lxc.cgroup.cpu.shares = 512
B: lxc.cgroup.cpu.shares = 512
C: lxc.cgroup.cpu.shares = 128
you run while(1) ++i;  in A, B C.  their cpu usage appears to be different
in machine having different cpu numbers:
1 cpu:
                2 cpu:
               cpu usage                                  cpu usage
         A        44.4%                                   A    100%
         B        44.4%                                   B     80%
         C        11.2%                                   C     20%
it is the result.


在 2011年8月24日 下午10:06,陈竞 <cj.magina at gmail.com>写道:

> i have a computer with 2 cores cpu. I want to create a container with 0.5
> cpu. I  found that cpuset.shares means how many time cpu time it get,
> but i don't know whether cpuset.shares point to one cpu or all cpu?
> if it points to one cpu, is the following configuratian right?
> lxc.cgroup.cpuset.cpus = 0
> lxc.cgroup.cpuset.shares = 512
> or just write:
>   lxc.cgroup.cpuset.shares = 256   if cpuset.cpus points to all cpus, while
> default value is 1024
>
> --
> 陈竞,中科院计算技术研究所,高性能计算机中心
> Jing Chen HPCC.ICT.AC China
>



-- 
陈竞,中科院计算技术研究所,高性能计算机中心
Jing Chen HPCC.ICT.AC China
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20110825/03f002e1/attachment.html>


More information about the lxc-users mailing list