proxmox CPU usage and hyperthreading

Sprinter

New Member
Jan 26, 2024
1
0
1
forgive me if this is too basic a question. I'm running a few containers for some light usage websites, as well as some game servers in containers. The cpu in question is 4 physical cores, 4 virtual. I was just wondering, should I be concerned when cpu usage display hits 50%? Does this mean all the physical cores are saturated? Or will it go to 100% without issue? Or does it depend?

Apologies for such a novice question, I appreciate any and all input. Thanks!
 
Depends if your CPU got hyperthreading or not. With hyperthreading, 50% CPU utilization means all physical cores are busy. Those other 50% are the hyperthreaded threads which only give you a fraction of the performance of a physical core.

By the way...PVE need performance to hypervise too or everything will be slowed down. With only 4 physical cores I personally wouldn't give a VM/LXC more than 3 vCPUs.
 
With hyperthreading, 50% CPU utilization means all physical cores are busy. Those other 50% are the hyperthreaded threads which only give you a fraction of the performance of a physical core.
Exactly. The performance of hyperthreading is often misunderstood. Hyperthreading is approximately 30% (it varies from almost zero to about 40% I think, depending on the nature of the workload) better than without hyperthreading. It's not a 2x boost. I think the overall CPU utilization with hyperthreading enabled is misleading. I'd prefer if it showed 100% when the number of active threads is equal to physical cores i.e. 8 threads on a 8C/16T CPU, and more than 100% to indicate the boost from hyperthreading. I know more than 100% doesn't really make sense, but it would represent the performance gain with hyperthreading enabled versus disabled. I guess the problem is the kernel has no way to know exactly how much performace gain there is from hyperthreading at any instant - would that be correct? So it's just easier to regard it as 16 cores.