VMware {code} Community
kucerj
Contributor
Contributor
Jump to solution

Making sense of cpu usage counter as reported by QueryPerf.

Hi everyone

I am writing a script that collects performance data, in particular cpu usage percentage, from various hosts and virtual machines.

I retrieve the data using QueryPerf function, in the same way that the viperformance.pl script does.

Recently I have noticed that the values for the cpu usage percentage are too large for a percentage ie. above 100.

At first I thought I have a bug in my script but then I noticed that the viperformance.pl script outputs the same values.

I run the viperformace.pl script like this:

./viperformance.pl --server xxx.xx.xx.x:xxx --username xxxxxx --password 'xxxxxxxxxx' --host xxxx.xxxxx.xxxxxx.xx --countertype cpu --samples 1

Performance data for: xxxx.xxxxx.xxxxxx.xx

Counter: CPU Usage (Average)

Instance :

Description: CPU usage as a percentage over the collected interval

Units: Percent

Sample info : 20,2009-05-22T08:27:20Z

Value: 538

Counter: CPU Usage in MHz (Average)

Instance :

Description: CPU usage in MHz over the collected interval. For hosts this can be represented on a per Virtual Machine basis as a stacked graph

Units: MHz

Sample info : 20,2009-05-22T08:27:20Z

Value: 1004

Can anyone explain what does the value of 538 mean? Do I have to process it further to get a real percentage?

Thank you very much

Jan

0 Kudos
1 Solution

Accepted Solutions
njain
Expert
Expert
Jump to solution

Hi Jan,

The value of cpu usage counter can be between 0 and 10000. This value is hundredth of a percent, so 1 = 0.01%.

Thus, in your case CPU Usage is actually 5.38% and 10.04% respectively.

Please refer to the counter documentation for more details.

http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/cpu.html

Hope this helps.

View solution in original post

0 Kudos
3 Replies
njain
Expert
Expert
Jump to solution

Hi Jan,

The value of cpu usage counter can be between 0 and 10000. This value is hundredth of a percent, so 1 = 0.01%.

Thus, in your case CPU Usage is actually 5.38% and 10.04% respectively.

Please refer to the counter documentation for more details.

http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/cpu.html

Hope this helps.

0 Kudos
LarryZio
Contributor
Contributor
Jump to solution

Hi Jan,

Do yourself a favor and read the pages for PerformanceManager and CPU counters as updated for vSphere API Reference Guide 4.0:

These pages are much more coherent, IMHO.

0 Kudos
heyitspablo
VMware Employee
VMware Employee
Jump to solution

Just FYI - I keep a doc with latest pointers to performance monitoring information and added links to the Ref Guide 4.0 - as suggested by LarryZio

http://communities.vmware.com/docs/DOC-9840

Keep up with latest info on vSphere PowerCLI http://blogs.vmware.com/vipowershell - Follow me on Twitter @heyitspablo
0 Kudos