VMware Cloud Community
SBaldridge
Contributor
Contributor

Guest vCPU performance best practices

I have a group of three ESXi 4.1.0 hosts in a cluster, they are Dell poweredge R710s with two 6-core 3ghz Xeon X5670 cpus with HT turned on so there are 24 logical processors to play with.  DRS is not enabled.  There is no Resource Pool configured.  The three guests are all Win2008 Std running SQL 2008, each with 4 vCPUs, they all have Resource Allocation/CPU at "High": no CPU reservation, CPU unlimited, there is no affinity or specific core sharing enabled.

We are basically running our SQL guests one-to-one on the hosts.  During our day I can see a guest load up on CPU at times, their workload is burst processing so most of the time they are idle but when they are crunching data they need the max CPU which is our goal.

Cluster CPU resources:  105 GHz (three hosts)

Host Resources: 36 GHz

If I look at the cluster>Resource Allocation each of the three hosts have 29% shares.

Today I saw one guest max out the ~9.8 GHz allocated to it, I was assuming that the 29% shares should be 30Ghz (cluster 105 ghz x .29).  Instead, the VM was getting ~10 ghz (host 36 ghz x .29).  At least that was my perception.  It appeared that a lot of the logical CPUs were idle.

I'm looking for some suggestions, this type of SQL cluster is new to us, we are used to a many-to-one host workload.  Should I be enabling DRS and creating a resource pool?  More or less vCPUs?

Thank you

0 Kudos
9 Replies
idle-jam
Immortal
Immortal

have a read at this resource page, it should help you with your question. http://www.vmware.com/solutions/business-critical-apps/sql/resources.html

0 Kudos
AureusStone
Expert
Expert

Your ESXi hosts map the vCPUs to physical CPUs.  So with 4 vCPUs to get 30Ghz you would need to be running a 7.5Ghz processor.

When you give a VM a high allocation that just means when there is resource contention on your hosts, the guests with the highest allocation will get most of the resources.  If all of your guests have the same role and same allocation, then your resource allocation won't actually do anything.

If you want to increase performance either increase the vCPUs if you have licenses, or check the BIOS configuration to ensure that things like power saving is off.

andershansendk
Contributor
Contributor

If you have the Enterprise Plus License you could try giving the VM's 8 vCPU's. I might give your better performance but thats is not always the case. If the SQL-servers are serving multiple databases you could scale-out, and make deploy a SQL-server for each database. Maybe with only 2 vcpu's per server. That could also give your better performance.

regards


Anders Hansen

Blog:  http://www.vperformance.org

Blog: www.vperformance.org
SBaldridge
Contributor
Contributor

Thanks for your suggestions, I'll run tests with 8 vCPUs vs the 4 in use already.  Unfortunately I can't scale out the workloads.

0 Kudos
COS
Expert
Expert

This is where understanding how "Hyperthreading" works is important. Sure you have 24 cores to "play with" but for all intents and purposes, you have 12. The other 12 is just another thread into each physical core. What we don't see is if the SQL VM you have is assigned to 4 physical cores OR 2 physical cores and 2 hyperthreaded cores into the same first 2 cores OR 4 hyperthreaded cores into 4 physical cores that are being used/hammered as well.

So in any case, if any one of your cores is hyperthreaded to a really busy core then your performance will be the speed of your heaviest used core. You can throw 8 cores at it but if just one of them is a hyperthreaded core into a busy physical core then your speed is the slowest hammered core.

Some people like hyperthreading, I don't for this very same reason.

0 Kudos
SBaldridge
Contributor
Contributor

So you disable HT on your hosts?  Are you doing that on the host BIOS or at the Host>config>Processors>Properties?

Thanks.

0 Kudos
COS
Expert
Expert

One other thing about a high CPU on a SQL server (i'm a SQL DBA), find out which query is causing the CPU to spike for such a long time. It's almost always going to be a TSQL query that has ooodles and oodles of nested INNER JOINS of Select statements or massive cursor iterations. Once you find it go slap the developers hand and tell them to knock it off.

0 Kudos
COS
Expert
Expert

In the BIOS, then we install ESXi.

Don't get me wrong, hyperthreading is good for small i/o stuff like IIS or licensing VM's and allows those to have higher density ESXi hosts, but not for high transactional CPU intensive VM's.

We have moved off of Intel based servers and use HP DL385 G7 servers with 24 physical cores (12 cores per physical CPU). 

0 Kudos
AureusStone
Expert
Expert

I know this is an old thread, but it came up in Google and I don't want people who find this thread to be misinformed.

If you have a 6 core processor with hyperthreading and you give a VM 6 vCPU it will be assigned to every physical CPU core.  The vCPU will never be mapped to a 'hyperthreaded' core.  When it comes to assigning vCPUs just forget about how many 'logical' CPUs you have.  How many physical cores you have is all that matters.

I have heard of many people who have turned off hyperthreading, because they believed that having hyperthreading on will make each vCPU have half the resources or lead to unpredictable results due to being mapped to a 'hyperthreaded' core

My recommendation is to have hyperthreading on by default.  If you are in a large enterprise and interested in performance optimisation; test with and without hyperthreading and see what works best for your applications and environment.

0 Kudos