OpenVZ Forum


Home » General » Support » *SOLVED* Using cpuunits to enforce CPU proportional shares
*SOLVED* Using cpuunits to enforce CPU proportional shares [message #10021] Mon, 05 February 2007 15:47 Go to next message
Pradeep Padala is currently offline  Pradeep Padala
Messages: 18
Registered: June 2006
Junior Member
Hi,

I am trying to enforce a CPU usage ratio by using the cpuunits option instead of cpulimit. For ex. I want to make sure that two VEs ve1, ve2 should have a CPU consumption ratio of 3:1 (proportional shares). I know that I can use cpulimit to do this, but is it possible to use cpuunits ? If I run two CPU consuming applications in ve1 and ve2, and specify a 3:1 ratio of cpuunits, would the VEs consume CPU in that ratio ?

I experimented with a simple while(1) loop and it doesn't seem to follow this. If this doesn't work, what's the use of specifying cpuunits ?

Pradeep

[Updated on: Wed, 07 February 2007 07:09] by Moderator

Report message to a moderator

Re: Using cpuunits to enforce CPU proportional shares [message #10027 is a reply to message #10021] Mon, 05 February 2007 16:46 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

Actually it should work as you expect: if cpuunits is 3:1, then first VE should have 3 times more CPU. So let's find out why this is not right for you.
Please, provide the information about the kernel you're using, how did you conduct the test, <veid>.conf files, vz.conf files, contents of /proc/user_beancounters, /proc/fairsched, /proc/fairsched2.

Thanks,
Vasily.
Re: Using cpuunits to enforce CPU proportional shares [message #10053 is a reply to message #10021] Tue, 06 February 2007 19:01 Go to previous messageGo to next message
Pradeep Padala is currently offline  Pradeep Padala
Messages: 18
Registered: June 2006
Junior Member
Ok, I re-checked it, and it works with a non-SMP kernel. But, with SMP kernel, the two processes (while(1)) running in the two VEs take the two CPUs and reach 100% consumption on both, no matter what cpuunits I set.
Re: Using cpuunits to enforce CPU proportional shares [message #10058 is a reply to message #10053] Tue, 06 February 2007 21:09 Go to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

this is correct.
OpenVZ cpu scheduler is work conservative, which means that if the most high priority VE can't consume all the power available to it, this resources are given to others.

in your case, a single process from VE1 can't consume 2 cpus, so second cpu is shared by others.


http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: *SOLVED* failcount, but how?
Next Topic: kernel: Fatal exception: panic in 5 seconds
Goto Forum:
  


Current Time: Tue Nov 12 06:46:29 GMT 2024

Total time taken to generate the page: 0.03445 seconds