VMware Cloud Community
FrancoisW
Contributor
Contributor
Jump to solution

Correct assignment of vCPUs to VMs

Hi All,

We have a physical server with 4 x Quad Core XEON E7310 1.6GHz CPU's

VMware ESX 3.5

We have 3 VMs assigned to the server

VM1 (Production Server) has following config

4 vCPUs, 16GB RAM and runs following:

OS - Windows Svr 2008 R2 (64-bit)

MS SQL Server 2008 (64-bit) (One database with one row data file and two log files)

IIS7 with only one ASP .NET Application (based on eXpress App Foundation (XAF) from DevExpress) running in Classic .NET App Pool (one worker process)

Web Application connection string points to database on same server (local)

Web app has a user base of around 250 users

VM2 (Dev Server) is the same as VM1 except it has only 8GB RAM

Now 4 x 1.6GHz Quad Core CPU's = 4 x 4 x 1.6GHz = 25.6GHz

VM1 has been assigned 16GHz (Reserved) and can use available CPU if required.

Our problem is that when we only have 10 users on VM1 it grinds to 80-100% CPU utilization.

Generally just opening the app on VM1 is slower than if I use a laptop as the server.

What can we do to improve the speed of VM1?

Thanks!

Reply
0 Kudos
1 Solution

Accepted Solutions
RParker
Immortal
Immortal
Jump to solution

2 Things. DISK is your problem, not CPU. It may run at 100% CPU, but it's probably because the DISK IO is queued up, and thus the CPU is waiting for data.

trying reducing the CPU to only 2 vCPU, not 4. More CPU work for physical machines, but VM's don't benefit from more CPU due the way virtual machines work (the same problem applies for any virtualization product).

View solution in original post

Reply
0 Kudos
7 Replies
RParker
Immortal
Immortal
Jump to solution

2 Things. DISK is your problem, not CPU. It may run at 100% CPU, but it's probably because the DISK IO is queued up, and thus the CPU is waiting for data.

trying reducing the CPU to only 2 vCPU, not 4. More CPU work for physical machines, but VM's don't benefit from more CPU due the way virtual machines work (the same problem applies for any virtualization product).

Reply
0 Kudos
FrancoisW
Contributor
Contributor
Jump to solution

Thanks for the response. However I don't think DISK IO is the issue, I have been checking the Network IO, Disk IO CPU usage and Memory allocation when the server hits 80-100%. It seems something else is causing it to queue up.

When I fire up SQL Server Management Studio on VM1 it takes between 8 to 12 seconds before presenting the connect dialog. On my laptop this takes just over 2 seconds.

Reply
0 Kudos
RParker
Immortal
Immortal
Jump to solution

When I fire up SQL Server Management Studio on VM1 it takes between 8 to 12 seconds

Fine have it your way. I have only been doing this VM Administration for over 3 years now, I am a MSCE windows Admin (for over a decade), and I do SQL administration, but what do I know, eh?

I didn't say DISK IO, I mean DISK response (type of disk, number of spindles)

On my laptop this takes just over 2 seconds.

Your laptop isn't running a VM now is it?

As I said, VM's are DIFFERENT than physical, take my advice or continue to beat your head on the wall and try to figure out what the problem is, DISK is the primary resource SQL uses.

VM's don't need 4 vCPU (even for SQL).

CPU depending on the DISK controller will cause higher CPU, more vCPU in a VM will increase your CPU usage exponentially.

FrancoisW
Contributor
Contributor
Jump to solution

Thanks for the detail.

I'll get our VMware Administrator to look into this next week.

I hope this resolves the issue.

Reply
0 Kudos
PacketRacer
Enthusiast
Enthusiast
Jump to solution

There's some crucial details missing from this to be able to troubleshoot the problem:

How much RAM is in the physical server? What kind of storage are you using? Do you have the VMware tools installed?

In the VI Client, if you select the physical server, and go to the Summary tab, look at the Resources pane. How is your CPU and Memory usage? Also, go to the Performance tab, and take a look at the graphs. You want to look at the Performance graphs for the physical server and for each VM, too. From the information in your post, only a couple of things pop out that may or may not be the problem:

1) The E7310 CPU is not a high performance CPU. You do have 16 cores, but they are only running at 1.6 Ghz

2) The advice about reducing the number of vCPUs for each VM is correct. If give the VM more vCPUs that you need, then you can actually cause a performance problem. It's best to take a look at the Performance graphs, and see if you are using the vCPUs or not. If you have 4 vCPUs but the graphs show that you are using less than 50%, then reduce the vCPUs down to two! Sometimes you will see virtual machines that simply can't use any more than 50% because the application that's running in the VM isn't multithreaded and can't take advantage of more than 1 core.

3) Storage makes a huge difference. If you run VMware on local storage, you will have performance problems. You need to run it on a SAN, and you need to have a large number of disks. Storage design for VMware is a topic that deserves a book of it's own, so I won't go into it, but pay attention to your disk queues.

4) Check out the esxtop command. If you Google for esxtop you will see a whole lot of guides on how to use it (perhaps too many). The only I like is called "Understanding esxtop" and you can find it here: http://communities.vmware.com/docs/DOC-11495

Hope this helps!

P.S. Another thing you should check out: Do you have any limits configured for your VMs? Are the VMs placed in a Resource Pool?

FrancoisW
Contributor
Contributor
Jump to solution

Thanks for your post.

I agree that the E7310's are a bit on the shy side in terms of performance...

I have much respect for RParker's comment regarding the number of vCPUs assigned to the VM.

I have unfortunately only entry level exposure to VM's and have relied on the Sys Admins to spec the VM.

I will look into this on Monday and get all the answers to the questions you have asked of me in order to assist.

I unfortunately cannot get to the VI Client.

I'll try and get our Sys Admin to join this post then.

Your assistance is much appreciated.

Reply
0 Kudos
FrancoisW
Contributor
Contributor
Jump to solution

When I fire up SQL Server Management Studio on VM1 it takes between 8 to 12 seconds

Fine have it your way. I have only been doing this VM Administration for over 3 years now, I am a MSCE windows Admin (for over a decade), and I do SQL administration, but what do I know, eh?

I didn't say DISK IO, I mean DISK response (type of disk, number of spindles)

Life is too short to learn only from one's own mistakes so after some more performance measurement, I concur that the disk queue seems to be the culprit here.

As I can only view this from the VM (I'm not the VM Admin) I have limited knowledge about the VM setup.

Your laptop isn't running a VM now is it?

As I said, VM's are DIFFERENT than physical, take my advice or continue to beat your head on the wall and try to figure out what the problem is, DISK is the primary resource SQL uses.

VM's don't need 4 vCPU (even for SQL).

CPU depending on the DISK controller will cause higher CPU, more vCPU in a VM will increase your CPU usage exponentially.

I used the laptop comparison only to confirm that the VM setup was causing the problem.

I will be suggesting we change the VM to only have two vCPUs.

Thanks for your accurate assessment.

I'll keep you posted.

Reply
0 Kudos