[SOLVED] High CPU usage reported inside VM while PVE shows low CPU usage

Jebula999

Member
Apr 18, 2024
30
3
8
Hi All,

I have a basic Windows VM setup for testing.
I recently put a Ryzen 5 3600 in it (6 cores 12 threads).

I have assigned the following to the server:
1719772697736.png

When running the server, and doing a mini "test". The CPU usage within the Windows VM jumps to >80% and slows down, but Proxmox still shows <10% usage.
I can notice the slow down and the low response time of the server in this scenario.
1719772917716.png

Am I assigning the cores/threads/CPU incorrectly?
Does it look like it's reporting correctly?

Still new to the whole cores/threads assignments
 
I don't know how Windows reports CPU usage but 86% with the graph so low could be 86% of 1 CPU, which is around 7% of 12 CPUs. I would say both numbers just about match.
 
Try setting Processors Type to Host & check results. Also I wouldn't give all of my 12 cores to just 1 VM.

I don't know how Windows reports CPU usage but 86% with the graph so low could be 86% of 1 CPU, which is around 7% of 12 CPUs
Look on the right side of OP's posted image. It appears its aware of all the CPUs.
 
  • Like
Reactions: Kingneutron
But look at the graph, which shows a line at the bottom. Maybe Windows is just confused?
The far right of the graph is hidden unfortunatly.
I can confirm that graph also goes to the same 80% at the same time
 
Last edited:
Also I wouldn't give all of my 12 cores to just 1 VM.
What is the downside to this?

I did a bit of reading on this, and from I could understand:
If you have a 12 thread CPU, and 4 VM's, you can assign all 4 VM's with 12 cores.
All VM's will be able use all 12 if needed, but the performance would be split when the max performance is reached.

Limiting all 4 VM's to say 3 each, meaning all running at 100% does not hit beyond the upper limit of 12.
But then on the odd chance one VM needs a bit more oomf, it can't get it, because it's limited to 4.

So by setting all to say 12, they all have access to all resources if needed on the odd chance, but will likely never use it together.


Sorry for the long back and forth explanation, struggling to put it into words.
The post I read did a much better job of explaining
 
Proxmox also needs cores to do emulation of virtual devices, logs and graphs and such. Giving 100% of any resource to any VM can introduce latency issues (as soon as another VM needs a little of that particular resource). This is usually fine for servers (max bandwidth and throughput) but is terrible for games (which stutter).

EDIT: Hyper-threads also should not be counted as full cores (since they share a lot of silicon with another thread). I tend to leave half of the threads to Proxmox, which gives a smooth experience (on AMD Ryzen).
 
Last edited:
  • Like
Reactions: Jebula999
Proxmox also needs cores to do emulation of virtual devices, logs and graphs and such. Giving 100% of any resource to any VM can introduce latency issues (as soon as another VM needs a little of that particular resource). This is usually fine for servers (max bandwidth and throughput) but is terrible for games (which stutter).

EDIT: Hyper-threads also should not be counted as full cores (since they share a lot of silicon with another thread). I tend to leave half of the threads to Proxmox, which gives a smooth experience (on AMD Ryzen).
Thanks for the input.
I'll drop it down to 6 and do some more testing

On this though, should I be counting how many cores I assign to each VM, and the sum of them be < the CPU threads on my CPU (in my case 12).
Or in your case half, so the sum of all cores assigned < half available threads (in my case 6)

I've read some posts of people running 30+ VM's on a +-12 thread CPU.
Is this where "CPU Limit" comes into play?
Although that I assume if you assign 1 core to a VM, and set CPU Limit to say 0.5, It's as if you assigned 0.5 cores.... which still forces that upper limit.
 
On this though, should I be counting how many cores I assign to each VM, and the sum of them be < the CPU threads on my CPU (in my case 12).
Or in your case half, so the sum of all cores assigned < half available threads (in my case 6)

I've read some posts of people running 30+ VM's on a +-12 thread CPU.
It's a balancing act. If you are not concerned about low-latency but want high-throughput then it's fine to over-commit on CPU. If most VMs are idle most of the time, it's fine to over-commit on CPU (until users start complaining). Such VM's typically have 2 or 4 virtual cores and are indeed mostly idle.
Is this where "CPU Limit" comes into play?
Although that I assume if you assign 1 core to a VM, and set CPU Limit to say 0.5, It's as if you assigned 0.5 cores.... which still forces that upper limit.
If you're running (this clustered enterprise hypervisor named) Proxmox at home, just find the right balance between VMs that are mostly idle but use many cores once in a while and the other VMs that only use a single core, most of the time.
Games still often don't need more than 4 cores, but a passthrough GPU and lots of memory (pinned because of the passthrough). A VM with a graphical desktop typically wants 1 core for the (software rendering of the) GUI, 1 core for the active application and 1 core for background processes (so give it 3 cores) and can use ballooning when not in active use (with CPU mostly idle).
 
  • Like
Reactions: Jebula999
Interestingly, I removed the windows VM from my testing.

I installed a new Ubuntu server, installed the same test on that VM, and the CPU usage in the VM now correlates with the CPU usage within PVE..
Must be something fishy with Windows that's either not showing the true CPU usage, or is limiting the CPU usage of the VM.

Thanks all for the input and extra knowledge learnt.
Will keep tinkering
 
Will keep tinkering
Thats the ultimate (maybe only) way of fine-tuning/balancing your system. No 2 HW/SW systems are the same.

The way I do it; initially for any LXC/VM I give it more resources than it actually "needs" & bring it down later after it's final setup/config is reached, fine-balancing it so that the VM & the whole system are still smooth-running.

Another goal I find useful - try using LXCs where possible, they are way more ecosystem-resourceful when setup correctly. But sometimes a VM is what's required not an LXC - and don't let yourself be tempted to setup some "awful" LXC just because you can - in the end it both won't get the job done & potentially slow down the whole system (& sometimes break it - read these forums).

Good luck.
 
For what it's worth, and if it sparks more feedback on Windows VM's.

Here's a clearer picture of CPU usage within the VM vs what PVE is reporting.

Windows VM - 100%
PVE - 24%

Not sure where the disconnect in values is happening.
1719843242106.png


I changed CPU to "host" and reassigned cores/RAM with testing.
1719843330950.png
 
I changed CPU to "host" and reassigned cores/RAM with testing.
This is evident in the new image in WTM showing your CPU name correctly.
However try with CPU limit set to unlimited. Also turn off Enable NUMA, (I imagine you anyway have only a 1 socketed PC with that Desktop CPU, & AMD chips use NUMA internally, which could potentially mess things up. Anyway try it at least as a test).
 
  • Like
Reactions: Jebula999
This is evident in the new image in WTM showing your CPU name correctly.
However try with CPU limit set to unlimited. Also turn off Enable NUMA, (I imagine you anyway have only a 1 socketed PC with that Desktop CPU, & AMD chips use NUMA internally, which could potentially mess things up. Anyway try it at least as a test).
Smooth as butter after disabling NUMA.
The CPU usage within Windows and within PVE are now reporting the same values.
Performance is also 100x faster and startup took a few seconds rather than a minute or two.

Thank you, learnt something new today, again.
 
  • Like
Reactions: gfngfn256
Happy you got it working. Maybe tag prefix the thread-title with [SOLVED], (upper right hand corner under title).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!