Book Image

vSphere High Performance Cookbook - Second Edition - Second Edition

By : Kevin Elder, Christopher Kusek, Prasenjit Sarkar
Book Image

vSphere High Performance Cookbook - Second Edition - Second Edition

By: Kevin Elder, Christopher Kusek, Prasenjit Sarkar

Overview of this book

vSphere is a mission-critical piece of software for many businesses. It is a complex tool, and incorrect design and deployment can create performance related issues that can negatively affect the business. This book is focused on solving these problems as well as providing best practices and performance-enhancing techniques. This edition is fully updated to include all the new features in version 6.5 as well as the latest tools and techniques to keep vSphere performing at its best. This book starts with interesting recipes, such as the interaction of vSphere 6.5 components with physical layers such as CPU, memory, and networking. Then we focus on DRS, resource control design, and vSphere cluster design. Next, you’ll learn about storage performance design and how it works with VMware vSphere 6.5. Moving on, you will learn about the two types of vCenter installation and the benefits of each. Lastly, the book covers performance tools that help you get the most out of your vSphere installation. By the end of this book, you will be able to identify, diagnose, and troubleshoot operational faults and critical performance issues in vSphere 6.5.
Table of Contents (17 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

CPU performance best practices


CPU virtualization adds varying amounts of overhead. Because of this, you may need to fine-tune the CPU performance and need to know what the standard best practices are.

The following are the standard CPU performance best practices:

  • You need to avoid using SMP VMs unless it is required by the application running inside the guest OS. This means if the application is not multithreaded, then there is no benefit of using the SMP VM.
  • You should prioritize VM CPU usage with a proportional share algorithm.
  • Use Distributed Resource Scheduler (DRS) and vMotion to redistribute VMs and reduce contention.
  • Use the latest available virtual hardware for the VMs.
  • Reduce the number of VMs running on a single host. This way, you can not only reduce contention, but also reduce the fault domain configuration.
  • You should leverage the application-tuning guide from the vendor to tune your VMs for best performance.

Getting ready

To step through this recipe, you need a running ESXi Server (licensed with Enterprise Plus for DRS), a couple of running VMs, and vSphere Web Client. No other prerequisites are required.

How to do it...

Let's get started:

  1. For the first best practice, you need to check whether the application is single threaded or multithreaded. If it is single threaded, then avoid running an SMP VM:
    1. You need to log in to vCenter using vSphere Web Client, then go to the Home tab.
    2. Once there, go to the VM and look at the VM Hardware tile.
    3. Now you can see whether the VM has one vCPU or multiple vCPUs. You see whether it's using them by looking at %Utilization or a similar metric for each vCPU:

Note

This Summary tab doesn't tell us whether the app is single threaded or multithreaded.

  1. For the second best practice, you need to prioritize the VM CPU using shares and reservation. Depending on the customer SLA, this has to be defined:
    1. You need to log in to vCenter using vSphere Web Client, then go to the Home tab.
    2. Once there, go to the VM, right-click on it, and then select Edit Resource Settings.
    3. In the CPU section, you need to define the Shares and Reservation values depending on your SLA and the performance factors.

By default, ESXi is efficient and fair. It does not waste physical resources. If all the demands could be met, all is well. If all the demands are not satisfied, the deprivation is shared equitably among VMs by default.

VMs can use and then adjust the shares, reservation, or limit settings. But be sure that you know how they work first:

  1. For the third best practice, you need to have a vSphere Cluster and have DRS enabled for this. DRS will load balance the VMs across the ESXi hosts using vMotion.

The first screenshot shows that the DRS is enabled on this vSphere Cluster:

The second screenshot shows the automation level and migration threshold:

  1. For the fourth best practice, you first need to see what virtual hardware the VM is running on; if it is not current, then you need to upgrade it. A virtual hardware version can limit the number of vCPUs:
    1. You need to log in to vCenter using vSphere Web Client, then go to the Home tab.
    2. Once there, go to Hosts and Clusters, then click on VM and look at the VM Hardware tile.

In the following example, it is version 10, which is old, and we can upgrade it to version 13.

Note

Take a VM snapshot prior to upgrading in order to mitigate the rare occurrence of a failure to boot the guest operating system after upgrading. For further information, refer to https://kb.vmware.com/kb/1010675.

  1. Now, to upgrade the virtual hardware of a VM, it has to be powered off. Then, start it again, right-click on VM, go to Compatibility, and then Upgrade VM Compatibility. It should give you a warning:
  1. Once you click on Yes, the virtual hardware version will be upgraded.
  1. For the fifth recommendation, you need to limit the number of vCPUs required by the VMs that would run on the host and the number of sockets/cores available in each physical host:
    1. Try to balance the CPU load of your VMs across all of your hosts
    2. Monitor the VMs for performance and adjust as necessary.
  2. For the last recommendation, you need to get the vendor-application-tuning guide and follow that to tune your virtual environment. A typical example is Microsoft Exchange Server 2016 Best Practices Guide.