Hi everyone! I'm pretty new to virtual machine setups and I could use some guidance. I just set up a server with 32 threads (which means 16 physical CPUs), but I'm running into issues with VM migrations not being stable. Right now, I've got only one VM on this server.
What I'm struggling to understand is the differing advice out there regarding CPU allocation. Some people say a 1:1 virtual CPU to thread ratio is best, while others recommend going with a 1:1 ratio of vCPU to pCPU. Since my VM is running an application that communicates over TCP on different ports and through Modbus serial with PLCs, any insights on how to properly allocate vCPUs would be incredibly helpful!
2 Answers
If your physical server has 16 cores and you have 2 VMs at 16 virtual cores each, that's overcommitting your physical resources. In a busy scenario, you may find each VM won't utilize all the assigned cores effectively. Depending on your application, 2 to 4 vCPUs might be sufficient. What's your application doing?
It could be that your PLC software has limitations affecting your VM migration, especially if it's sensitive to disruptions. With one VM, you might want to stick with a 1:1 vCPU to pCPU ratio and disable hyper-threading. That way, you're reserving enough resources for the hypervisor too. Migration issues usually aren't about CPU overcommitment but rather how the applications handle it, so keep that in mind!
Exactly! I've seen similar stun issues with PLC software, especially when backups run and snap management kicks in. It's often a communications break issue, so checking those aspects could help.

It's a proprietary app for managing truck loading at oil depots, handling everything from queues to temperature calculations for multiple trucks at once.