VMware Cloud Community
Aravindakumar
Contributor
Contributor
Jump to solution

Regarding CPU Allocation

My Physical Server is 2 Socket Quad Core 2.6 Ghz( total 8 Cores ) , I am creating a db server with 8 vCPU and resource setting with 10000 Mhz Reservation and 10000 Mhz Limit. Now does all the 8 Cores be involved in serving the CPU requests?
If I add further VMs for the remaining 10000 Mhz , say 4 VMs with 2 vCPU each with 2500 Mhz Reservation and 2500 Mhz Limit ? how does the cores allocation happens in serving the requests?

Thanks in advance

Aravind

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
weinstein5
Immortal
Immortal
Jump to solution

Consider that I am assigning 7vCPUs, will that still be a problem ?

That should help -

Also the reason I am setting cpu reservation values is that i want to make sure that CPU is being guranteed for that VM, actually we are migrating the DB Server from Physical to Virtual , I want to make sure that resources are available for the DB Server.

That is the correct use of reservationis - my comment was more of a reminder of if you set resrvatrions to all the VMs on your host you will come to point will you will not be able to power on additional VMs even though there might be available resources -

Regarding your comment start with fewer vCPU and add more if needed , for DB Servers which we are migrating from physical to virtual and know that desired capacity is needed , how do we apply that concept of fewer vCPU and and more vCPU when desired ? Please guide me on the same.

Have you looked at the CPU consumption on the physical boxes? Just because teh physical box has 8 cores does note mean you will need 8 vCPUs and also keep in mind you will are probably moving to a much faster CPUs. The added benefit as you set up the new VM is if 4 cores is not sufficient adding additional cores is an easy operation-

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

View solution in original post

0 Kudos
11 Replies
tomtom1
Enthusiast
Enthusiast
Jump to solution

Are you sure about that 10000 Mhz ? I don't think you can calculate the speed of cores in this manner. But, I may be wrong. Will love to hear, what people have to say about it.

0 Kudos
Aravindakumar
Contributor
Contributor
Jump to solution

Hi ,

  What I meant to say is that, for the VM I will set the number of CPUs to 8 and Resources tab setting , I will set the CPU Reservation and Limit values to 10000 Mhz. Is that not reasonable to set?

0 Kudos
tomtom1
Enthusiast
Enthusiast
Jump to solution

I don't want to hijack your thread. I dont think the calulation of cores and the figure of 8*2.6 Ghz = 20.8 Ghz is correct way. But, I may be wrong.

Normally, I have seen we start with less and add more vCPU as needed.  Trying a VM with 8 vCPU does not makes much sense to me.

0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

Welcoem to the community -A few things to point out -

  1. Having only 8 cores availanle in your host and assign 8 vCPUs to your you will definitely run the risk of causeing contention for CPU resources between the VM and the ESXi host itself since each vCPU will run on its own core
  2. As on of the other posters stated - you should always start with fewer vCPUs and add more if needed --
  3. I qould not set limits because that will cap the consumption of that resource so if you are in a situation where the VM needs more VM resources but is at its limit it will not get any more even if there are CPU cycles available -
  4. Set reservations when needed because if the ESXi host cannot satisfy the reservation for a VM it will not start - 
If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
Aravindakumar
Contributor
Contributor
Jump to solution

Hi,

Consider that I am assigning 7vCPUs, will that still be a problem ?

Also the reason I am setting cpu reservation values is that i want to make sure that CPU is being guranteed for that VM, actually we are migrating the DB Server from Physical to Virtual , I want to make sure that resources are available for the DB Server.

Regarding your comment start with fewer vCPU and add more if needed , for DB Servers which we are migrating from physical to virtual and know that desired capacity is needed , how do we apply that concept of fewer vCPU and and more vCPU when desired ? Please guide me on the same.

Thanks in advance

0 Kudos
Gkeerthy
Expert
Expert
Jump to solution

First of all, it is not recommended to use limits in esx environment, it will affect your performance

refer link http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=103311...

For VCPUs refer

http://communities.vmware.com/docs/DOC-4960

http://www.vmware.com/pdf/vsmp_best_practices.pdf

http://www.yellow-bricks.com/2008/07/07/multiple-virtual-cpu-vms/

http://www.boche.net/blog/index.php/2011/05/21/co-scheduling-visualized/

http://blog.scottlowe.org/2008/06/30/vmware-esx-cpu-scheduling-information/

So in theory, giving more Vcpus dont give higher performance, example - if you give 4 vcpus to a vm, and that vm is using around 40 % or 60 % on peak time, for the same vm if you give 2 Vcpus and that vm us using around 90 % on peak time - this setup will give more performance than the 4 vcpu one.

Because of the co-scheduling, vmkerel has to wait and allocate time for each extra VCPU assingned to a VM.

as suggested by weinstein5

give only 1 vcpu and add later, first you need to have a capacity planner report of the entire work load of the physical server, what is the CPU memory usage etc. Then give 2 or 4 vcpus for DB server, again based on the current usage.

Also dont count the virtual cores given by the HT, HT dont give higher performance, on production it is recommended and best practice that, take the count of physical cores only and accomodate that many vms, if you have 20 cores, 20 vms with 1 vcpus each, HT just makes the processor busy with the instructions.

Entire concept of CPU and Memory management is too complex, so simple rule is give 2 vcpus to the db and monitor its activity and later give additional vcpus. Setting reservation for this DB vm is good so that it will always get the CPU resource. Also you can use CPU shares for the other less critical VMS in the esx host,

Please don't forget to award point for 'Correct' or 'Helpful', if you found the comment useful. (vExpert, VCP-Cloud. VCAP5-DCD, VCP4, VCP5, MCSE, MCITP)
weinstein5
Immortal
Immortal
Jump to solution

Consider that I am assigning 7vCPUs, will that still be a problem ?

That should help -

Also the reason I am setting cpu reservation values is that i want to make sure that CPU is being guranteed for that VM, actually we are migrating the DB Server from Physical to Virtual , I want to make sure that resources are available for the DB Server.

That is the correct use of reservationis - my comment was more of a reminder of if you set resrvatrions to all the VMs on your host you will come to point will you will not be able to power on additional VMs even though there might be available resources -

Regarding your comment start with fewer vCPU and add more if needed , for DB Servers which we are migrating from physical to virtual and know that desired capacity is needed , how do we apply that concept of fewer vCPU and and more vCPU when desired ? Please guide me on the same.

Have you looked at the CPU consumption on the physical boxes? Just because teh physical box has 8 cores does note mean you will need 8 vCPUs and also keep in mind you will are probably moving to a much faster CPUs. The added benefit as you set up the new VM is if 4 cores is not sufficient adding additional cores is an easy operation-

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
AmeenMunaf
Contributor
Contributor
Jump to solution

So, is it advisable to give the CPU shares to make sure this VM gets preference over others, instead of adding more CPUS

With Many Thanks Ameen Munaf
0 Kudos
joshodgers
Enthusiast
Enthusiast
Jump to solution

Please review my recent blog on the topic as it covers your question in detail.

http://joshodgers.com/2012/07/22/common-mistake-using-cpu-reservations-to-solve-cpu-ready/

Also beware of oversizing VMs, see the below.

http://joshodgers.com/2012/07/25/vm-right-sizing-an-example-of-the-benefits/

Josh Odgers | VCDX #90 | Blog: www.joshodgers.com | Twitter @josh_odgers
COS
Expert
Expert
Jump to solution

IMHO, If it's a DB server, focus on the disk IOPS first, then the CPU. Start with 4vCPU's and tune your disk IOPS for best performance.

DB servers are disk intensive and poor queries are CPU intensive AND disk intensive. Your bottleneck will be your disk.

The CPU scheduler does a good job at managing cpu cycles. Just don't have Hyperthreading turned on.

Thanks

0 Kudos
AmeenMunaff
Enthusiast
Enthusiast
Jump to solution

Hi COS,

Any particular reason on why u dont want hyperthreading to be enabled??

Regards, Ameen Munaf
0 Kudos