How to check exact CPU utilization of a VM

jagan

Active Member
Feb 11, 2015
93
0
26
india,chennai
Hi All,

Where can I check the accurate CPU & RAM utilization of VM? The values which are seeming on web GUI are not the same as in Taskmanager (Windows) / top or atop (Linux).

1. The % of CPU utilization in VM > Summary > Status is keep on varying to various values. Some times it is quickly changing from 6% to 100+%.
2. In the CPU usage graph, some times the usage values are giving in "m" and some times it is showing 00+. What it means ? is it % of CPU utilization?

Thanks.
 

LnxBil

Famous Member
Feb 21, 2015
4,439
447
103
Germany
Where can I check the accurate CPU & RAM utilization of VM?
The question is what accurate means :-D

From the outside (PVE), you will monitor the real CPU usage the VM causes on your real CPU, which is always at least as high as the usage inside your VM. From the inside, you will see the utilization that the guest OS sees from the virtual CPU.
 

jagan

Active Member
Feb 11, 2015
93
0
26
india,chennai
The question is what accurate means :-D

From the outside (PVE), you will monitor the real CPU usage the VM causes on your real CPU, which is always at least as high as the usage inside your VM. From the inside, you will see the utilization that the guest OS sees from the virtual CPU.
I am confused, please explain to me the below doubts.

1. You mean outside (in PVE UI), the CPU usage graph of a VM designates the usage of physical CPU cores or virtual CPU cores assigned to that VM?
2. How & Where can I check the actual usage of virtual CPU of guest OS in PVE WEB UI (Outside)?
3. In the CPU usage graph, the metric "m" indicates what?
4. How come the VM CPU graph & % CPU usage goes beyond 100%?
 

LnxBil

Famous Member
Feb 21, 2015
4,439
447
103
Germany
1. You mean outside (in PVE UI), the CPU usage graph of a VM designates the usage of physical CPU cores or virtual CPU cores assigned to that VM?
It monitors the actual CPU usage of the kvm processes corresponding to your VM. These processes do not only represent the CPU, they also represent the memory and all emulated devices to your guest. Therefore their CPU usage is always at least as high as the virtual cpu usage inside of your VM.

2. How & Where can I check the actual usage of virtual CPU of guest OS in PVE WEB UI (Outside)?
You cannot. You can only in the VM itself.

3. In the CPU usage graph, the metric "m" indicates what?
I guess this indicates milli (see SI), but I haven't seen it by myself. Can you please post a screenshot?

4. How come the VM CPU graph & % CPU usage goes beyond 100%?
See 1.
 

jagan

Active Member
Feb 11, 2015
93
0
26
india,chennai
It monitors the actual CPU usage of the kvm processes corresponding to your VM. These processes do not only represent the CPU, they also represent the memory and all emulated devices to your guest. Therefore their CPU usage is always at least as high as the virtual cpu usage inside of your VM.

You mean it represents CPU (host cpu ) usage of the kvm processes corresponding to a VM? Then how can I configure the dedicated cpu cores to a VM?

You cannot. You can only in the VM itself.

If we can't monitor the actual usage of the virtual CPU of a guest VM in UI, what is the use of having a CPU usage graph in WEB UI?
Based on this usage graphs we are doing capacity planning for newer vms.

I guess this indicates milli (see SI), but I haven't seen it by myself. Can you please post a screenshot?

Please check the attached screenshot. Is it really representing the % of CPU usage or server load or CPU wait time or any other?

See 1.
I am confused here. if I assign 4 virtual cores to a vm out of 32 threads (host has 2*8Cores*2threads = 32 threads or virtual cores), that vm should not cross the 100% usage of 4 virtual cores, right? But here some times it is crossing 100%.

Thanks for your response.
 

Attachments

LnxBil

Famous Member
Feb 21, 2015
4,439
447
103
Germany
Thank you for the image. That is "background noise" indeed. So your machine does almost nothing.
 

jagan

Active Member
Feb 11, 2015
93
0
26
india,chennai
Thank you for the image. That is "background noise" indeed. So your machine does almost nothing.
That I Knew. Please help me with my other doubts.

1. You mean it represents CPU (host cpu ) usage of the kvm processes corresponding to a VM? Then how can I configure the dedicated cpu cores to a VM?

2. If we can't monitor the actual usage of the virtual CPU of a guest VM in UI, what is the use of having a CPU usage graph in WEB UI?
Based on this usage graphs we are doing capacity planning for newer vms.

3. Please check the attached screenshot. Is it really representing the % of CPU usage or server load or CPU wait time or any other?

4. I am confused here. if I assign 4 virtual cores to a vm out of 32 threads (host has 2*8Cores*2threads = 32 threads or virtual cores), that vm should not cross the 100% usage of 4 virtual cores, right? But here some times it is crossing 100%.
 

LnxBil

Famous Member
Feb 21, 2015
4,439
447
103
Germany
What I just realized ... what version are you using? the graph looks very old. Is this still PVE 3 or 4?

Then how can I configure the dedicated cpu cores to a VM?
Short answer: You cannot dedicate a CPU core. Every virtual CPU is scheduled on any free CPU on the hypervisor.

Longer answer: You can pin processes to cpus via taskset, which sets cpu affinity. This is not part of the GUI and normally no one cares about it and it can slow down a VM significantly if the process is scheduled on one cpu and most of its memory in on another numa node behind the other processor.

2. If we can't monitor the actual usage of the virtual CPU of a guest VM in UI, what is the use of having a CPU usage graph in WEB UI?
Based on this usage graphs we are doing capacity planning for newer vms.
The actual cpu usage is significant, not the one in the VM/guest and that is monitored. You need to plan with that number.
All information in the GUI comes directly from the qemu/kvm interface. Feel free to look at their documentation, which is much better than anything I can try to explain.

3. Please check the attached screenshot. Is it really representing the % of CPU usage or server load or CPU wait time or any other?
I cannot say. I do not have such an old system anymore that uses rrdtool graphs. For new systems, the graph is better:

1575576291878.png

4. I am confused here. if I assign 4 virtual cores to a vm out of 32 threads (host has 2*8Cores*2threads = 32 threads or virtual cores), that vm should not cross the 100% usage of 4 virtual cores, right? But here some times it is crossing 100%.
Not for me, so I cannot help there.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!