VMware Cloud Community
Mouchel
Enthusiast
Enthusiast
Jump to solution

Managing Resources

Can anyone point me in the right direction to best practice guides for managing CPU resouces. In particular, use of shares, allocation of CPU's, benefit of using more the 1 vCPU. Our situation is that we have a SQL 2005 VM sitting on a Host with 4 x 2.66 GHz physical cores. The SQL admin wants his box to have access to all the CPU resource when needed (not too often) and for the other VM's to migrate elsewhere in the cluster (plenty of capacity across 5 other hosts). I don't want to starve the co-hosted VM's ( all with 1 x vCPU) unncessarily, although I'm happy for them to migrate if needs be. Also, in the above scenario where all our VM's have been allocated 1 x vCPU, does this limit them to 2.66 GHz resource, even if the host has more available?

0 Kudos
1 Solution

Accepted Solutions
dpomeroy
Champion
Champion
Jump to solution

I would try to give him 2 vCPUs and then monitor performance to see if it is acceptable. I is always easier to add more resources then take them away after being assigned. The other option is to increase the shares to the SQL VM so that it will take priority when there is resource contention, this plus 2 vCPUs might be enough to guarantee the performance he needs without have to set CPU affinity or moving VMs around.

The other thing to consider if you have VI3 Enterprise is to let DRS work on fully auto. In this case the VMs will automatically be migrated with the cluster to balance performance for all VMs.

Don Pomeroy

VMTN Communities User Moderator

View solution in original post

0 Kudos
5 Replies
Texiwill
Leadership
Leadership
Jump to solution

Hello,

First off, with only 1 vCPU assigned to the VM it will be impossible for you to give 100% of the host to the VM. YOu would need 4 vCPUs for that at the least and a lot more memory assigned to the VM than it really needs. I would at most give them a second vCPU as since it is SQL and SQL is a threaded application it can handle that quite well. See how they react with just 2 vCPUs....

I tend to give out resources with an eye dropper requiring justification. If they want 100% of the box you will need to give them 100% of the box. SO make it a physical server, otherwise they will NEVER get 100% of the box (purely mathematical). THe virtualization and SC will take some away from 100%. So in general such requests seem unreasonable to me in a virtualized environment.

If they only have 1-2 vCPUs moving other VMs off the machine is not really required either as there are free resources on the system and they should be used. You really want to find the minimum resources necessary to run the task in a reasonable time period. I would do some testing....

task run with 1 vCPU, 2 vCPUs, then 4 vCPUs keeping the other VMs on the system as well. You may be surprised by the results. Also note that if there are only 3 1 vCPU VMs on the system then everyone is running all the time on their own core.... WIth 4 Cores, 3 for VMs and 1 for SC/vmkernel is the maximum you can run without there being scheduling issues.

Best regards,

Edward L. Haletky, author of the forthcoming 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', publishing January 2008, (c) 2008 Pearson Education. Available on Rough Cuts at http://safari.informit.com/9780132302074

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
dpomeroy
Champion
Champion
Jump to solution

I would try to give him 2 vCPUs and then monitor performance to see if it is acceptable. I is always easier to add more resources then take them away after being assigned. The other option is to increase the shares to the SQL VM so that it will take priority when there is resource contention, this plus 2 vCPUs might be enough to guarantee the performance he needs without have to set CPU affinity or moving VMs around.

The other thing to consider if you have VI3 Enterprise is to let DRS work on fully auto. In this case the VMs will automatically be migrated with the cluster to balance performance for all VMs.

Don Pomeroy

VMTN Communities User Moderator

0 Kudos
Mouchel
Enthusiast
Enthusiast
Jump to solution

Thanks for the reply. I've done as you guys have suggested and allocated 2 vCPU's to the SQL server and we already have DRS set up on our cluster. I've adjusted the shares to 5000 also. I must confess that shares are still a bit of a mystery to me and I'm unclear as to how they fit in / compliment other resource management mechanisms. Any further insight into using shares or pointers to documentation which makes understanding easier would be gratly appreciated. Cheers.

0 Kudos
Texiwill
Leadership
Leadership
Jump to solution

Hello,

SHares tell the system how much of a resource to give a VM. However it is an additive process:

Default: 4 1 vCPUs VMs + SC (2000) = 6000 shares.

2 vCPU Default: 1 2 vCPU VM + 3 1 vCPU VMs + SC (2000) = 7000 shares.

This implies that the 2 vCPU VM has 2x the shares of the other 3 VMs. So each vCPU will run appropriately.

If you increase this 2 vCPU VM to 5000 shares, then the total # of shares also increases by 3000 shares.

New: 1 2 vCPU VM (5000) + 3 1 vCPU VMs + SC (2000) = 10000 shares.

THis means that the 2 vCPU VM has 1/2 of the CPU resources and the other 3 VMs have 1/10 each when they run. WHich means that they take up less time on the CPUs when the pCPUs are over committed. In your case with 4 Cores, you are over committed as you need 6 cores to run everything simultaneously.... Never forget that 1 Core is needed by the vmkernel/SC. But it boils down to the fact that one VM will now run 5x longer than the other VMs, when the 2 vCPU VM does run.

Make sense? As you increase the number of shares on the LHS, the RHS increases appropriately as well. This is the hard part to realize, you may have to do the math to determine how much of and how long a VM will run on a pCPU compared to the other VMs.

Best regards,

Edward L. Haletky, author of the forthcoming 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', publishing January 2008, (c) 2008 Pearson Education. Available on Rough Cuts at http://safari.informit.com/9780132302074

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
Mouchel
Enthusiast
Enthusiast
Jump to solution

Great help texiwill, I understand...now I'll try and get my haed around resource pools ?:|

0 Kudos