OpenVZ Forum


Home » General » Support » cpuunits
cpuunits [message #50944] Sun, 08 December 2013 05:37 Go to next message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
Hello,

i know, this topic was already often here and on google, but i dont understand completly cpuunits.

My test server: 200% CPU, 2 Cores.
Current CPU utilization: 121111
Power of the node: 180006

When i want to garantuee one VE 50% CPU share then i would need to assign 90000 cpuunits, right?

I made some tests with stress testers.
When i assign one VE 2000 cpu units, it get on stresser 100% cpu and the other two VEs get 50% cpu (i checked with top).

Shouldnt it be, that at 2000 cpuunits the VE gets around 55% cpu and not 100%? 100% is the half of the total node and i took only 2000.
If i use the full cpu units of the node to the VE (vzctl set 101 --cpuunits 180000), then it is the same result as when i assign only 2000.

Can please sometime spend his time and explain a dumb person like me how this can be?

Please see my test results. Already when i make the interger value +1 the ve get much more cpu. It dont make the results better when i make the interger more high.

Thanks so much, my head is already smoking and my brain working and working but, hmm... ok, please help Smile))

PS: If every VE have the same cpuunits, then it is like fair use of all containers?

Test results:
VE 100, cpuunit 1000
real    1m43.342s
user    1m5.196s
sys     0m0.101s

VE 101, cpuunit 1000
real    1m42.879s
user    1m5.365s
sys     0m0.084s

VE 102, cpuunit 1000
real    1m29.582s
user    1m5.063s
sys     0m0.135s


VE 100, cpuunit 1001
real    0m13.094s

VE 101, cpuunit 1000
real    0m17.058s

VE 102, cpuunit 1000
real    0m16.851s


VE 100, cpuunit 20000
real    1m15.323s
user    1m5.034s
sys     0m0.069s

VE 101, cpuunit 1000
real    1m40.064s
user    1m5.291s
sys     0m0.100s

VE 102, cpuunit 1000
real    1m43.121s
user    1m4.120s
sys     0m0.135s


VE 100, cpuunit 180000
real    1m5.432s
user    1m5.188s
sys     0m0.035s

VE 101, cpuunit 1000
real    1m44.517s
user    1m5.314s
sys     0m0.115s

VE 102, cpuunit 1000
real    1m45.020s
user    1m5.059s
sys     0m0.225s


VE 100, cpuunit 180000
real    1m5.673s
user    1m5.115s
sys     0m0.105s

VE 101, cpuunit 1000
real    1m47.805s
user    1m0.395s
sys     0m0.106s

VE 102, cpuunit 500
real    1m32.997s
user    1m5.217s
sys     0m0.151s


VE 100, cpuunit 1500
real    1m31.839s
user    1m5.296s
sys     0m0.092s

VE 101, cpuunit 1000
real    1m46.488s
user    1m0.188s
sys     0m0.104s

VE 102, cpuunit 2000
real    1m12.817s
user    1m5.029s
sys     0m0.076s

[Updated on: Sun, 08 December 2013 06:16]

Report message to a moderator

Re: cpuunits [message #50945 is a reply to message #50944] Sun, 08 December 2013 09:55 Go to previous messageGo to next message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
http://forum.openvz.org/index.php?t=msg&goto=49227&# msg_49227
Re: cpuunits [message #50946 is a reply to message #50944] Sun, 08 December 2013 10:22 Go to previous messageGo to next message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
But at max cpuunits for this server it still needs:
real    1m5.673s
user    1m5.115s
sys     0m0.105s


Normally this needs just 30 sek if the VE has full ressources. But when other VEs are running with 1000 cpuunits it needs 1min 5 sek.
Shouldnt the VE which has all cpuunits get the full cpu?

Quote:
if ct1 has 1000 cpuunits and ct2 had 3000 cpuunits it means only that ct3 gets 3times more cpu.
But 3000 cpu units are just (as example) 1% guaranteed, depending on hardware node, right?

[Updated on: Sun, 08 December 2013 10:22]

Report message to a moderator

Re: cpuunits [message #50947 is a reply to message #50944] Sun, 08 December 2013 13:27 Go to previous messageGo to next message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
Quote:
Shouldnt the VE which has all cpuunits get the full cpu?

Quote:

if ct1 has 1000 cpuunits and ct2 had 3000 cpuunits it means only that ct3 gets 3times more cpu.

But 3000 cpu units are just (as example) 1% guaranteed, depending on hardware node, right?


no. and why 1%? if you want limit CT cpu resources for example no more than 10% so set cpus to 1 and cpulimit to 10.

please read my answer again.

repeating:
cpuunits is relative value. it doesn't matter if you give 10000/30000 or 1000/3000 or 100000/300000. it only means that CT with more cpuunits will get relatively more cpu on high load. AFAIK it doesn't mean that say one CT will get 1000 cpu cycles, other CT 3000, or with more cpuunits it will get 100000 cpu cycles and other CT 300000.

if you want to limit CT cpu resources it is cpulimit, cpus, and cpumask parameters.


Re: cpuunits [message #50948 is a reply to message #50947] Sun, 08 December 2013 17:01 Go to previous messageGo to next message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
thanks, i think i understand it now.
i have just one more questions:

Is there no need to scale my cpuunits to the hn node power output of vzcpucheck? My english is too bad to absolutly understand the man page, but i think i need to scale it?

Example, total cpu units of hn node 110000. so i make
ve 100 - 10000
ve 101 - 20000 - get ~2 time more cpu
ve 102 - 30000 - get ~3 time more cpu
ve 103 - 50000 - get ~6 time more cpu, and get about 2.5 time more than ve 101.is this correct?
Re: cpuunits [message #50997 is a reply to message #50948] Thu, 19 December 2013 16:05 Go to previous messageGo to next message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
Van somebody answer my final question?

thanks

[Updated on: Thu, 19 December 2013 16:05]

Report message to a moderator

Re: cpuunits [message #51009 is a reply to message #50997] Mon, 23 December 2013 19:46 Go to previous messageGo to next message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
push
Re: cpuunits [message #51011 is a reply to message #50944] Mon, 23 December 2013 21:38 Go to previous messageGo to next message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
Hi,
what is real problem you want to solve?

btw. https://wiki.openvz.org/CPU_Fair_scheduler
Re: cpuunits [message #51012 is a reply to message #50944] Mon, 23 December 2013 21:44 Go to previous messageGo to next message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
Quote:
Is there no need to scale my cpuunits to the hn node power output of vzcpucheck? My english is too bad to absolutly understand the man page, but i think i need to scale it?

Example, total cpu units of hn node 110000. so i make
ve 100 - 10000
ve 101 - 20000 - get ~2 time more cpu
ve 102 - 30000 - get ~3 time more cpu
ve 103 - 50000 - get ~6 time more cpu, and get about 2.5 time more than ve 101.is this correct?


Thanks.
Re: cpuunits [message #51013 is a reply to message #50944] Mon, 23 December 2013 22:04 Go to previous messageGo to next message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
it seems you don't get it so I repeat:

what is real problem you want to solve?

If you want direct answer, imho leave cpuunits as is. for better control of cpu limitations for CT's I already answered in my first reply.
Re: cpuunits [message #51014 is a reply to message #51013] Tue, 24 December 2013 01:10 Go to previous message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
I want to know:
- would my example caluclation be correct?
- does i need to make calculation depended of output from vzcpucheck? So VEs from server A have other cpuunit value at server B to get same result?

>what is real problem you want to solve?
have no problem. i want to understand the calculation and this information is the missing part.
Previous Topic: High Load
Next Topic: cpuunits #2
Goto Forum:
  


Current Time: Sun Oct 06 12:38:36 GMT 2024

Total time taken to generate the page: 0.04362 seconds