according to my test cpu.shares just points to per cpu time, suppose you have 3 container, A ,B, C :<br>A: lxc.cgroup.cpu.shares = 512<br>B: lxc.cgroup.cpu.shares = 512<br>C: lxc.cgroup.cpu.shares = 128<br>you run while(1) ++i; in A, B C. their cpu usage appears to be different in machine having different cpu numbers:<br>
1 cpu: <div id=":166"> 2 cpu:<br> cpu usage cpu usage<br> A 44.4% A 100% <br> B 44.4% B 80%<br>
C 11.2% C 20%<br>it is the result.</div><br><br><div class="gmail_quote">在 2011年8月24日 下午10:06,陈竞 <span dir="ltr"><<a href="mailto:cj.magina@gmail.com">cj.magina@gmail.com</a>></span>写道:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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,<br>
but i don't know whether cpuset.shares point to one cpu or all cpu? <br>
if it points to one cpu, is the following configuratian right?<br>lxc.cgroup.cpuset.cpus = 0<br>lxc.cgroup.cpuset.shares = 512<br>or just write:<br> lxc.cgroup.cpuset.shares = 256 if cpuset.cpus points to all cpus, while default value is 1024<br clear="all">
<font color="#888888">
<br>-- <br>陈竞,中科院计算技术研究所,高性能计算机中心<br>Jing Chen <a href="http://HPCC.ICT.AC" target="_blank">HPCC.ICT.AC</a> China<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>陈竞,中科院计算技术研究所,高性能计算机中心<br>Jing Chen <a href="http://HPCC.ICT.AC">HPCC.ICT.AC</a> China<br>