8.26 Configure Xen CPU Frequency Scaling for Best Performance

The Xen hypervisor offers a mechanism to balance performance and power consumption through CPU frequency scaling. Known as the Current Governor, this mechanism can lower power consumption by throttling the clock speed when a CPU is idle.

Certain versions of Oracle VM Server have the Current Governor set to ondemand by default, which dynamically scales the CPU clock based on the load. Oracle recommends that on Oracle PCA compute nodes you run the Current Governor with the performance setting. Particularly if you find that systems are not performing as expected after an upgrade of Oracle VM Server, make sure that the Current Governor is configured correctly.

To verify the Current Governor setting of a compute node, log in using SSH and enter the following command at the Oracle Linux prompt:

]# xenpm get-cpufreq-para
cpu id               : 0
affected_cpus        : 0
cpuinfo frequency    : max [2301000] min [1200000] cur [2301000]
scaling_driver       : acpi-cpufreq
scaling_avail_gov    : userspace performance powersave ondemand
current_governor     : performance
scaling_avail_freq   : *2301000 2300000 2200000 2100000 2000000 1900000 1800000 1700000 1600000 1500000 1400000 1300000 1200000
scaling frequency    : max [2301000] min [1200000] cur [2301000]
turbo mode           : enabled
[...]

The command lists all CPUs in the compute node. If the current_governor parameter is set to anything other than performance, you should change the Current Governor configuration.

To set performance mode manually, enter this command: xenpm set-scaling-governor performance.

To make this setting persistent, add it to the grub.cfg file.

  1. Add the xen cpu frequency setting to the /etc/default/grub template file, as shown in this example:

    GRUB_CMDLINE_XEN="dom0_mem=max:6144M allowsuperpage dom0_vcpus_pin dom0_max_vcpus=20 cpufreq=xen:performance max_cstate=1"
  2. Rebuild grub.cfg by means of the following command:

    # grub2-mkconfig -o /boot/grub2/grub.cfg