Rate This Document
Findability
Accuracy
Completeness
Readability

Usage Guidelines

Shut down all VMs before tuning and restoration, and restart the host OS after tuning and restoration are complete to make the settings take effect.

This tool is a shell script. It has three parameters tuning, verify, and restore, which are used for tuning, verification after tuning, and restoration after tuning. Contact the R&D team to obtain the tool.

Tuning Procedure

You need to run the following command in the directory of the HiKVMPerf.sh file to perform tuning. Before running the command, ensure that the VM is shut down.

1
sh HiKVMPerf.sh tuning

The tuning process is as follows:

  1. Back up the original configuration, including the grub.cfg file and the VM XML file, to the backup directory in the current directory.
  2. (Optional) Disable THP.

  3. (Optional) Configure 512 MB huge pages.

  4. (Optional) Configure NUMA Aware.

    Set the number of reserved cores. The tool binds all VMs on the physical machine to cores and some cores need to be reserved for the physical machine. The value range is 0 to 24, and the recommended value is 4. The tool automatically redefines the VM after the XML file is modified.

  5. Restart the physical machine for the settings to take effect.
    1
    reboot
    

The tool checks the CPU and memory overcommitment. Memory overcommitment is not allowed. The maximum memory usage cannot exceed 80%, and the maximum CPU overcommitment ratio is 1:3.

Verification After Tuning

Check whether the settings take effect after restart.

  1. Run the following command in the directory of the HiKVMPerf.sh file to verify the tuning result:
    1
    sh HiKVMPerf.sh verify
    

  2. Run the following commands to check whether the settings have taken effect:
    1. Check whether THP is disabled.
      1
      cat /sys/kernel/mm/transparent_hugepage/enabled
      

    2. Check whether the memory huge page settings have taken effect.
      1
      2
      cat /proc/sys/vm/nr_hugepages
      cat /sys/devices/system/node/node*/meminfo | grep Huge
      

    3. View the VM XML file (including the memory huge pages and NUMA Aware configuration).

      For example, run the following command to check the configuration of VM 1:

      1
      virsh dumpxml vm1
      

      The preceding figure shows that the THP has been disabled, the huge pages function has been enabled, and the VM has been bind to cores.

Restoration After Tuning

  1. Run the following command to check whether the VM is shut down. The VM must be shut down before the restoration.
    1
    virsh list --all
    

  2. Run the following command in the directory of the HiKVMPerf.sh file to perform restoration.
    1
    sh HiKVMPerf.sh restore
    

  3. Reboot the system to make the operation take effect.
    1
    reboot