Rate This Document
Findability
Accuracy
Completeness
Readability

Tuning the OS

Tune the OSs of the physical machine and VM to improve server performance.

Physical Machine

Modify the GRUB parameters to tune the OS of the physical machine.

  1. Open the /etc/grub2-efi.cfg file.
    vi /etc/grub2-efi.cfg
  2. Press i to enter the insert mode and add the following input/output memory management unit (IOMMU) configurations to the end of the kernel parameters:
    iommu.passthrough=1 pci=realloc kvm-arm.vgic_v4_enable=1

    kvm-arm.vgic_v4_enable=1 is applicable only to new Kunpeng 920 processor models.

  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Restart the physical machine OS for the configuration to take effect.

Virtual Machine

Configure huge page memory, enable cluster scheduling tuning, and optimize network performance, memory management, number of NIC queues and interrupt-core binding to tune the VM OS.

  1. Configure huge page memory for the VM.
    1. Open the /etc/grub2-efi.cfg file.
      vi /etc/grub2-efi.cfg
    2. Press i to enter the insert mode. Add the following huge page configuration to the end of the kernel parameters:
      default_hugepagesz=2M hugepagesz=2M hugepages=12500
      • The setting of hugepages=12500 is based on a VM that is allocated with 32 GB memory.
      • You are advised to set the value of hugepages to at least 75% of the actual VM memory.
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Restart the VM OS for the configuration to take effect.
  2. Enable cluster scheduling tuning.

    For details, see Cluster Tuning Guide.

  3. Optimize the network performance and memory management of the VM OS, and enable the scheduling tuning feature.
    echo 8192 >/proc/sys/net/ipv4/tcp_max_syn_backlog
    echo 1024 >/proc/sys/net/core/somaxconn
    echo 16777216 >/proc/sys/net/core/rmem_max
    echo 16777216 >/proc/sys/net/core/wmem_max
    echo "4096 87380 16777216" >/proc/sys/net/ipv4/tcp_rmem
    echo "4096 65536 16777216" >/proc/sys/net/ipv4/tcp_wmem
    echo 360000 >/proc/sys/net/ipv4/tcp_max_syn_backlog
    echo 5 >/proc/sys/vm/dirty_ratio
    echo STEAL > /sys/kernel/debug/sched_features
  4. Optimize the number of NIC queues and interrupt-core binding.

    Set the number of NIC queues to 1. Disable the irqbalance service to prevent unbalanced allocation of interrupts among different CPU cores.

    systemctl stop irqbalance
    systemctl disable irqbalance
    ethtool -L ens6 combined 1

    After the number of queues is set to 1, interrupts use one core by default. No additional interrupt-core binding operations are required.