VMware {code} Community
Tim_Wise
Contributor
Contributor

Are 'Per CPU' performance counters per core or per logical CPU?

I'm in VI client looking at the host CPU metrics on the Peformance tab and see CPU usage reported 'per CPU.' I know in an unvirtualized Window environment the 'number of CPUs' is dependent on whether hyperthreading is on or off. I wondering how the VMware kernel is reporting 'number of CPUs.'

Are they reported 'per core' or are they 'per logical CPU'? Are there more if hyperthreading is turned on? Based on the documetation for how CPU usage is comptued, I think VMware is reporting 'per core.'

My virtualized host doesn't support hyperthreading so I cannot test that here. I see one CPU per core.

Tim

0 Kudos
3 Replies
admin
Immortal
Immortal

When the entity being queried is HostSystem object, the Instance Ids are the cpu number. This correpsonds to the logical cpu number when hyperthreading is enabled. E.g. "0", "1"

When the entity is a VirtualMachine object, the instance ids are the cpu number. E.g. "0", "1", referring to individual vcpus.

Tim_Wise
Contributor
Contributor

Thanks, dkaur. That makes sense given the way hyperthreading works.

Now, when figuring host CPU usage, the Performance Counters documentation says usage is computed as

usage = usagemhz / (num cores * cpu frequency) * 100%

In this equation, is 'num cores' the number of cores or the number of logical processors?

I have to believe it is the number of cores because the max usagemhz of a core is its frequency, regardless of whether it is running 1 or 2 threads (logical processors). Also, usage should be a measure of utilization of the physical machine, regardless of whether hyperthreading is on or off.

Tim

0 Kudos
Tim_Wise
Contributor
Contributor

Resolved: CPU usage is computed using number of cores.

0 Kudos