VMware Cloud Community
ashleymilne
Enthusiast
Enthusiast

Changing number of Vcpu's in a VM

I know when you look at the summary of a VM, specifically the Vcpu's it says that decreasing the number of Vcpu's may make a VM unstable, is this always true, of Windows Server VM's ? I have inherited a host where several servers, one a terminal server, the other an Exchange 2010 server, have 2 Vcpu's installed, when one with two cores would likely suffice, however I don't want to change things if the servers will not boot, crash or be horribly unstable, I just think they are over provisioned. The VM's are currently on a 4.0 host and will be moved to a 5.1 host running update 2, the new host has 8 cores or 16 with hyper threading, faster disk and more memory, I am more concerned that they VM's are running poorly because they are over provisioned. The Exchange server hosts email for roughly 75 users, the VM's have been in production for four years.

0 Kudos
11 Replies
vThinkBeyondVM
VMware Employee
VMware Employee

Hi Friend,

  Below blog post can make your understanding very clear around vCPU allocation etc:

Virtual CPUs – The Overprovisioning Penalty of vCPU to pCPU ratios | ZDNet

Virtualization: vCPU Provisioning Best Practices | The Little Things


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

0 Kudos
ashleymilne
Enthusiast
Enthusiast

Thanks Vicky, from what I read, it seems that performance may be degraded due to over provisioning as the number of Vcpu's currently allocated meets or exceeds the number of cores in the single CPU host, however moving the VM's to a new host with double the amount of cores, my alleviate the contention for CPU cycles, however I may still consider reducing the number of Vcpu's in the VM's.

0 Kudos
Ethan44
Enthusiast
Enthusiast

Hi

Welcome to communities.

you may go with up gradation if have another cpu slot instead of reducing VMS. .

0 Kudos
ashleymilne
Enthusiast
Enthusiast

Do you mean add a second physical CPU? I don't have this option on my host.

0 Kudos
JPM300
Commander
Commander

Typically you never want to assign more vCPU's then your hosts have, for instance say you have a host that has 1 Intel CPU with 4 cores.  You woudln't want to assign more then 4 vCPU on a VM otherwise you will get CPU scheduling issues which will give poor perofmance.  Now lets say you have a host with 2 Intel CPU 4 cores a piece.  It would be a good idea to still keep your VM's set to no more then 4vCPU's as each CPU as 4 cores and if you give a VM 8 vCPU it has to corss the NUMA memory threshold in the system and schedule cycles on the 2nd CPU.   Memory sends instructions very fast from CPU to its local bank of memory but when it has to go to another bank of memory it looses a little speed.  Its still fast just not as fast.   For more information do some googling on NUMA and Vmware as there is LOTS of good material on it.


In long and short of it is try and keep your vCPU's as low as possible on hosts to prevent CPU ready time, and CPU scheduling issues.

I hope this has helped.

0 Kudos
ashleymilne
Enthusiast
Enthusiast

Thank you, I understand, the issue is I have a host with VM's that are over provisioned for CPU's, the host has a single quad core processor which gives it eight cores with hyper threading (not sure if hyper threading is relevant to this conversation) I will be moving the VM's to a new host with a CPU that has eight cores or sixteen with hyper threading, so I think performance will improve, but I may have to reduce the Vcpu's in some of the VM's.

0 Kudos
JPM300
Commander
Commander

Also when your doing your vCPU assignments, don't take hyper-threading into account as a true core, yes it gives you double the threads and it looks like you have 16 cores on a 8 core CPU which does help, but what happens with hyperthreading is when it splits a core it still uses the same CPU cache for that core.  So now you can have two threads competting for that same cache, which could cause some vCPU scheduling issues.  If you have a 8core CPU I wouldn't count it as 16 even though you still have that processing power, I would count it as 8 and never set a VM past 8 vCPU's.  It will make the schedulers job that much easier on ESX.

I hope this has helped.

0 Kudos
ashleymilne
Enthusiast
Enthusiast

So I was able to shut down various VM's running Server 2008R2, Server 2008 standard and Server 2003 standard, and reduce the number of virtual CPU's from 2 to 1, all the VM's started up no issues, this was in my home lab. For my client who is running ESXi 4, I wonder if I should make the changes before or after migrating to the new host running ESXi 5.1 update 2? Thoughts?

0 Kudos
JPM300
Commander
Commander

I would make the changes after if everything is running fine now.  You can upgrade everything make sure all the VM's are happy, then reduce the VM's vCPU's.  Things like SQL and Exchange though I would give a minimum of 2 vCPU's as they typically run better with 2 or run like crap with 1 as they are designed to be multi-cpu applications.

Hope this has helped

0 Kudos
ashleymilne
Enthusiast
Enthusiast

So I understand that its bad to over provision vCPU's, what about one vCPU with two cores? That can't be as bad as over provisioning on vCPU's? It seems though that ESXi sees one vCPU with two cores as two vCPU's though.

0 Kudos
JPM300
Commander
Commander

Yes, Vmware is essentially doing the same thing if you set a VM with 2vCPU's or 1vCPU with 2Cores.  The reason the core metric is there is to get around OS limitations.  For instance Server 2003 Standard had a max CPU count you could go to, so to get around this you could assign more cores to your vCPU's to assist with high CPU requirements.  Prior to 5.0 or 5.1 I forget which version it become a drop down selection this used to be an advanced feature where you would have to enter a line into your VM's advanced config to give it more cores.

Hope this has helped.

0 Kudos