softwareRat
softwareRat

Reputation: 55

Setting up the optimal number of processors/cores per processor virtual machine (VMware)

I was looking for an answear but didn't find one. I'm trying to create a new VM to develop a web application. What would be the optimal processor settings? I have i7 (6th gen) with hyperthreading. Host OS: Windows 10. Guest OS: CentOS.

Off topic: RAM that should I give to VM should be 50% of my memory? Would it be ok? (I have 16GB RAM)

Upvotes: 1

Views: 8952

Answers (1)

DevOps Dan
DevOps Dan

Reputation: 1853

This is referred to as 'right-sizing' a vm, and it is dependent on the application workload that will run inside it. Ideally, you want to provide the VM with the minimum amount of resources the app requires to run correctly. "Correctly" is subjective based upon your expectations.

Inside your VM (CentOS) you can run top to see how much memory and cpu % is being used. You can also install htop which you may find friendlier than top.

RAM

If you see a low % of RAM being used, you can probably reduce what you're giving the VM. If you are seeing any swap memory used (paging to disk), you may want to increase the RAM. Start with 2GB and see how the app behaves.

CPU

You'll may want to start with no more than 2vCPUs, checkout top to see how utilized the application is under load, and then make an assessment for more/less vCPUs.

The way a hosted hypervisor (VMware Workstation) handles guest CPU usage is through a CPU scheduler. When you give a vm x number of vCPUs, the VM will need to wait till that many cores are free on the CPU to do 'work'. The more vCPUs you give it, the more difficult (slower) it will be to schedule. It's more complicated than this, but I'm trying to keep it high level. CPU scheduling deep dive.

Upvotes: 7

Related Questions