OpenVZ Forum


Home » General » Support » vzctl set cpuunits and vzcpucheck strange behaviour
vzctl set cpuunits and vzcpucheck strange behaviour [message #38674] Thu, 14 January 2010 21:14 Go to next message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
I don't know if I missed something or is it just a bug....

kernel 2.6.18-164.2.1.el5.028stab066.10
vzctl-3.0.23-1

in each HN i have 1 CT runing (httpd, mysql with replication)

so there is a command sequence on HN
#vzctl set 502 --cpuunits 1000 --save
Setting CPU units: 1000
Saved parameters for CT 502

#vzcpucheck
Current CPU utilization: 2000
Power of the node: 160011

ok

#vzctl set 502 --cpuunits 10000 --save
Setting CPU units: 10000
#vzcpucheck
Current CPU utilization: 11000
Power of the node: 160011

emm ok

#vzctl set 502 --cpuunits 30000 --save
Setting CPU units: 30000
#vzcpucheck
Current CPU utilization: 32250
Power of the node: 160011

emmm why 32250 not 31000??

ok, let it be...

# vzctl set 502 --cpuunits 120000 --save
..
Current CPU utilization: 126000

+6000

ok
# vzctl set 502 --cpuunits 130000 --save
Current CPU utilization: 167666
Power of the node: 160011
Warning: hardware node is overcommitted

emm, what??
# vzctl set 502 --cpuunits 124000 --save
..
Current CPU utilization: 126000

# vzctl set 502 --cpuunits 125000 --save
..
Current CPU utilization: 126000

final
# vzctl set 502 --cpuunits 126000 --save
# vzcpucheck
Current CPU utilization: 167666
Power of the node: 160011
Warning: hardware node is overcommitted


so...
why some time vzctl set and vzcpuchkeck gives different expected result.
why setting cpuunits to 126000 gives hardware overcomitted while hardware node has power of 160011
Re: vzctl set cpuunits and vzcpucheck strange behaviour [message #38675 is a reply to message #38674] Fri, 15 January 2010 03:03 Go to previous messageGo to next message
dedicados is currently offline  dedicados
Messages: 46
Registered: February 2009
Location: Mexico
Member

mmm i think this:

you do this
#vzctl set 502 --cpuunits 10000 --save
Setting CPU units: 10000
#vzcpucheck
Current CPU utilization: 11000
Power of the node: 160011


you are setting to the VE 502 the cpuunits and you are doing "vzcpucheck" but you dont specify the VE

so maybe vzcpucheck are checking the whole server so you get that values, your 10000 + 1000 of other VE ? or main SERVER ??

Re: vzctl set cpuunits and vzcpucheck strange behaviour [message #38680 is a reply to message #38675] Fri, 15 January 2010 07:24 Go to previous messageGo to next message
Paparaciz
Messages: 302
Registered: August 2009
Senior Member
yes, I know that CT0 takes 1000
easy to check:
# vzcpucheck -v

my question is why setting cpuunits to 30000 it makes all cpu utilization not 31000 but 32250
and why while systems power is 160010, setting cpuunits to 130000 makes not 131000, but 167666 cpu utilization of the node
Re: vzctl set cpuunits and vzcpucheck strange behaviour [message #42468 is a reply to message #38680] Wed, 20 April 2011 11:11 Go to previous message
davidh is currently offline  davidh
Messages: 1
Registered: April 2011
Junior Member
The answer is simple. There is some magic number 500.000 in the code which is used to round numbers. I found the origin here: wiki.openvz.org/Fairsched_API#CPU_limit

So I found my vzcpucheck value of 479343 and I want every vz container to have 1/7 of the cpu time == 68477. When I enter this with vzctl I get 71428 as the value which is set.

Here is how the 500.000 number works: 500.000/71428 is an int! The next best lower number is 62500 cpuunits. When I enter that 7 times I get underbooking (which is what I want).
Previous Topic: service vz start, command not found centOS 5.5
Next Topic: yum update : vzeventmod
Goto Forum:
  


Current Time: Fri Oct 18 12:21:39 GMT 2024

Total time taken to generate the page: 0.04964 seconds