Node CPU Utilization
Hi,
While getting a hardware node's CPU utilization, I'm getting values between .0 and 1.0. These values however do not seem to correspond to load on the domains themselves. I have a program that print these values once a second for all cpus on the node:
import XenAPI
import time
session = None
def print_cpu_utilization():
# Find a non-template VM object
cpus = session.xenapi.host_cpu.get_all()
while True:
for cpu in cpus:
load = session.xenapi.host_cpu.get_utilisation(cpu) print load
time.sleep(1)
url = 'httpu:///var/run/xend/xen-api.sock'
username = 'fakeuser' # we run as root, dont worry about auth password = 'fakepass'
# First acquire a valid session by logging in:
session = XenAPI.Session(url) session.xenapi.login_with_password(username, password) print_cpu_utilization()
Some observations:
* If I run a program with only a tight loop on dom0, this seems to affect the figures printed out by this program. One of the CPUs exhibits values near .8 or .9
* If I run the same tight loop on a HVM domain, the printed values don't seem to be affected.
* With an increase in the number of guest domains (HVM), the values printed by the program goes up. For example, I started 2 HVM domains and the values for 2 CPUs on my system stayed near .4, even if the domains were doing nothing.
* When I start the 3rd domain, however, it takes ages to start. Even though, as per utilization figures, only about 40% of the CPU is loaded.
I'm running Xen 3.1 on a Fedora Core 7 system. Please share your thought on this.
Regards,
Signature · 5 lines
Shuveb Hussain. Money has nothing to do with Happiness, But, Poverty has a lot to do with Sorrow. Company: www.binarykarma.com Blog: www.binarykarma.org