Thanks for the explanation, but I DID use the --cpulimit parameter.<br><br>I set the limit to 1000 units, I run a while(1) loop, and I see a 100% loadavg on the host node. Shouldn't it be somewhere around 10% ?<br><br>Pradeep
<br><br><div><span class="gmail_quote">On 6/6/06, <b class="gmail_sendername">Kir Kolyshkin</b> <<a href="mailto:kir@openvz.org">kir@openvz.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Looks like you misunderstand the concept of cpuunits. cpuunits is not a<br>hard limit, but just a suggestion, and a CPU time is shared<br>proportionally to the values given. So, if you will have 9 VEs and the<br>host system with cpuunits set to 1000 for all of them, and run the loop
<br>in all of them, each VE will use 10% of the CPU time.<br><br>In case you will stop the loop running in 5 VEs so there will be 4 such<br>VEs (plus the host system) left, each of them will use 20% of the CPU.<br>So, all the CPU time is distributed between VEs which will need it,
<br>according with their proportional cpuunits.<br><br>More to say, the concept of "total CPU units" is purely fiction, and is<br>here just for the convenience. People do want to set CPU units is terms<br>of processor's megaherts, and this is what cpuunits does. But in fact it
<br>is not a megaherts but just a relative weights. I.e. all the cpuunits<br>values are relative to each other, it doesn't matter what the actual<br>numbers are -- what matters is a number given to a VE in relation to the
<br>sum of all cpuweights (which is expressed as "total CPU units" just for<br>the convenience).<br><br>So, cpuunits, if you do not oversell them, are a CPU guarantee, not a<br>limit. If you want CPU limit -- use cpulimit parameter.
<br><br>Pradeep Padala wrote:<br><br>> Hi,<br>><br>> I am trying to measure the CPU utlilization of the VZ containers, and<br>> change the cpu share dynamically. I have poured over most of the<br>> documentation, and looked at the code as well, and it seems like
<br>> there's no utility that can directly show the current CPU utilization<br>> of a container (some thing like 30% of CPU). A search on the user list<br>> got me a message, where someone suggested using loadavg. However, It
<br>> seems like the loadavg is not showing the proper utilization (or<br>> showing the total CPU utilization). This is what I am doing.<br>><br>> I setup a container with 1000 units limit (total CPU units: ~10000). I
<br>> wrote a small do {; }while(1); loop and ran it in the container, now I<br>> do cat /proc/loadavg in both the container and on the host node.<br>> Since, the container is only using 1000 units, I should see something
<br>> like 100% loadavg in the container, and 10% loadavg in the hostnode.<br>> But, I see 100% at both places. Am I doing something wrong? How do I<br>> get the current cpu utilization of a container?<br>><br>
> Thanks,<br>> --<br>> Pradeep Padala<br>> <a href="http://ppadala.blogspot.com">http://ppadala.blogspot.com</a><br>><br>>------------------------------------------------------------------------<br>><br>
>_______________________________________________<br>>Users mailing list<br>><a href="mailto:Users@openvz.org">Users@openvz.org</a><br>><a href="https://openvz.org/mailman/listinfo/users">https://openvz.org/mailman/listinfo/users
</a><br>><br>><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openvz.org">Users@openvz.org</a><br><a href="https://openvz.org/mailman/listinfo/users">https://openvz.org/mailman/listinfo/users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Pradeep Padala<br><a href="http://ppadala.blogspot.com">http://ppadala.blogspot.com</a>