Section 4.4. CPU Management, Affinity


4.4. CPU Management, Affinity

VMware ESX Server allows you to control access to the CPUs on which the Service Console and your virtual machines run. This management is in the form of minimum and maximum percentage values, as well as shares.

A minimum percentage value is the minimum amount of time that either the Service Console or the virtual machine is guaranteed on a particular processor. The maximum percentage value is the maximum amount of time that the Service Console of a virtual machine is guaranteed on a particular processor or processors if you are running virtual smp.

As shown in Figure 4.3, a default build of one of our ESX Servers gave the Service Console the following access to Processor0.

Figure 4-3. Default CPU Access for the Service Console


The values located under the Resources heading show that the Service Console will receive a minimum of 8 percent availability of the processor capacity while the most, or the maximum, it can utilize is 100 percent.

Designing & Planning…
CPU Percentage Values

Minimum CPU percentage establishes the lowest limit of a CPU that a virtual machine will always be able to utilize. If the virtual machine cannot reserve its minimum CPU percentage, it will not be able to power on. The admission control policy enforces this, guaranteeing the minimum CPU allocation.

Maximum CPU percentage establishes the highest limit of consumption the virtual machine can have on a CPU. The virtual may never exceed this usage since it is a fixed allocation, and can not be exceeded even if there are idle CPU cycles available.


The Service Console is also configured with 2,000 shares. Shares represent a relative priority. This priority denotes which virtual machines will have priority or preferential access to the CPU.

VMware describes shares in the following manner: "the shares value represents a relative metric for allocating processor capacity, where this value is compared to the sum of all shares of all virtual machines on the server and the Service Console."

In our example of the Service Console, it has been allotted 2,000 shares on processor0. Since the Service Console has been allocated 2,000 shares, it has priority access on processor0 over a virtual machine, which by default is configured to Normal.

Configuring & Implementing…
CPU Access Shares

Shares can be allocated in two ways:

  • Numerical values

  • High, Normal, or Low

Numerical values can be 100, 200, 1000, 2000, and so on. Using numerical values, you can set the priority access that is right for you, as well as for your ESX Server and the virtual machines running on it. However, you have to document and keep track of what each virtual machine's access is and be mindful of how it reacts with the other virtual machines and the Service Console.

By default, virtual machines are set to Normal. Normal has twice the shares of Low, while High has twice as many shares as Normal. If you were to view this numericallysay, if Low equaled 100Normal would be 200, and High would be 400 shares.


Note that these default settings can be edited if needed. By selecting Edit… link, the window shown in Figure 4.4 will be displayed.

Figure 4-4. Editing CPU Resources with VMware ESX Server 2.5


The Service Console is given a higher default priority on processor0 for pretty obvious reasonsif the Service Console doesn't have access to its processor, management of your ESX Server will take a performance hit. To ensure the Service Console always has access to processor0, you could bump up the minimum to 100 percent. This is rarely, if ever, needed and is not recommended. You could create the same effect through the use of CPU Affinity, which we'll discuss later in this chapter.

Let's compare the default CPU configuration of a virtual machine to that of the default Service Console configuration and then discuss what possible tweaks you may want to make in order for your virtual machine to perform more optimally.

Figure 4.5 shows the default configuration of a Windows 2003 Server, Standard Edition.

Figure 4-5. The Default Configuration of Windows 2003 Server, Standard Edition


This virtual machine has one virtual CPU with a minimum setting of 0 percent, a maximum of 100 percent, and its shares set to Normal. Also note that the Scheduling Affinity option is available. It's here where you can choose on which CPU(s) you want your virtual machines to run. This option is not available for the Service Console since it always runs on processor0. By clicking the Edit link, you may adjust your CPU resources to better meet the needs of your virtual machines.

Let's say you want this particular virtual machine to run on processors 2 and 3. The change might look like the settings shown in Figure 4.6

Figure 4-6. Setting CPU Affinity


By default, every virtual machine is given access to all processors running. But we have chosen this virtual machine to run only processors 2 and 3 by clicking the Do Not Run On Processor(s) radio buttons 0 and 1.

For CPU-intensive virtual machines, you might also want to increment the Minimum value to a level where the virtual machine is guaranteed a performance high enough for its service level. Changing the affinity of your CPUs, as well as the minimum and maximum values and the CPU shares, allows for virtual machines of high CPU requirements and low CPU requirements to exist harmoniously. Affinity comes into play more in larger NUMA ESX hosts.




Virtualization With VMware ESX Server
Configuring VMware ESX Server 2.5 (Vol 1)
ISBN: 1597490199
EAN: 2147483647
Year: 2005
Pages: 173

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net