7

I'm a complete VMware know-nothing, but I recently set up 4 VMs on ESXi. 3 of the VMs are very non-resource-intensive (a lightly used file server, a lightly used domain domain controller, and a VMware vMA host), and one is more resource intensive (a terminal server used by a dozen people in my small office).

The terminal server VM has been running quite slowly during peak hours. Taking a look at the performance summary in vSphere, it does seem that the CPU has been spiking above 90% quite a bit, My disk latency graph has some spikes in it too, occasionally going up to 500ms or so.

I have not configured any of the resource allocation settings in VMware, and always assumed that it would be smart enough to allow busier VMs to use available resources when less busy VMs didn't need them. It appears that this isn't the case, though, because the CPU chart for the overall server never spikes above 10%, and the disk latency never goes above 4ms or so.

So that tells me that perhaps I need to configure some of the resource allocation stuff in VMware, but I don't quite understand what I should configure in this situation. Should I increase the number of vCPUs or configure processor affinity? Or should I use the shares or reservation features? Essentially, I don't want to completely starve the other VMs of resources, but I do want the terminal server to be able to use the system resources that appear to be available.

Thanks in advance for any guidance.

1
  • 1
    I would suggest you buy faster hard drives and raid them up. The majority of performance issues with VM's are because whoever build the system skimped on the hard drives.
    – Ardesco
    Sep 4, 2013 at 15:02

2 Answers 2

5

In ESXi a vCPU will be mapped to a core on a real CPU core for computation. This means that a VM configured with 1 vCPU on a system with 4 cores can never use more than around 1/4th of the capacity of the system. Generally speaking, you do not want to configure VM's with too many vCPU's (as additional vCPU's adds overhead), nor too few (as you can not use the full capacity of the hardware).

For such a simple scenario as you describe you should not have to mess around with the resource allocation system or processor affinity. By default ESXi uses a system which assigns a fair share of resources to each vm, where configured resources are used to calculate how many shares a VM get. So you don't really have to worry about starvation.

There is a lot to learn about performance in ESXi, but I would recommend starting with reading through the best practices if you want to know how to configure the system for reasonable performance.

7
  • 1
    For brevity's sake, yes, you could add one more vCPU and see if that helps but don't just add them on a lark, each one requires management overhead so you not only get diminishing returns but eventually are wasting resources if not making things go even slower Sep 4, 2013 at 12:25
  • 1
    @TheFiddlerWins: My experience with ESXi is that the scheduling has improved significantly and the overhead for configuring systems with multiple vCPU's has been reduced with each generation. While it was certainly true for some early versions of ESXi that you could back the system in a corner by running VM's with too many vCPU's I have not seen that behavior in years. Are you sure it is still possible to get things to go slower by adding vCPU's to a vm in scenarios without heavy vCPU over-subscription and load?
    – pehrs
    Sep 4, 2013 at 12:37
  • 1
    The last VMware seminar I attended agreed with you other than to say the problem is not completely gone. Sep 4, 2013 at 12:46
  • Thanks, this is helpful. This machine has 12 cores, and I only have the default 1 vCPU configured for each of the 4 VMs. So if each VM is being mapped to only one core, I suppose it makes sense that the terminal server is under-resourced and the overall box is under-utilized. If I'm not over-subscribing CPUs, is there something to lose by giving this VM, say, 4 vCPUs? Or does it remain a possibility that doing so could actually worsen performance?
    – Martin
    Sep 4, 2013 at 15:18
  • Giving each server 4 vCPU should be fine in your scenario. You will get a large performance boost for the VMs and utilize your hardware more efficiently. But that is an oversubscription of the CPU, as you would have assigned 4*4 = 16 vCPU to 12 cores. Oversubscription means that you have assigned more resources to your virtual machines than is available on the physical hardware, and rely on the fact that all machines don't use the resources at the same time.
    – pehrs
    Sep 4, 2013 at 16:08
4

This may be a case of inadequate resources on the terminal server VM's side.

  • What resources have you allocated to this particular VM?
  • What resources are available on the ESXi host?

There could be heavy memory use which leads to virtual memory paging/swapping. That could impact the disk I/O of your individual terminal server VM without having a larger effect on the hypervisor.

Look at the terminal server's memory use. Possibly increase it if you can. Evaluate the CPu utilization as well. Adjust accordingly if you have the spare resources.

3
  • The system has 48GB RAM, of which 24GB is allocated to the terminal server. RAM usage on the VM is pretty low, so I'm assuming this isn't the problem. The system has 2 CPUs with 6 cores each (Xeon 2.3GHz). Thanks.
    – Martin
    Sep 4, 2013 at 15:22
  • How many vCPUs are assigned to the VM?
    – ewwhite
    Sep 4, 2013 at 15:26
  • I never configured vCPUs, so they're all set to the default of 1. Based on the other comment below, it sounds like this could be my problem; it may seem obvious, but I wasn't aware that this would limit my VM to use one physical core.
    – Martin
    Sep 4, 2013 at 15:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .