how to configure host OS parameters to enhance performance

  • turn on the speedstep in BIOS and configure kernel parameters in host OS

– if the box supports turbo-boost, turn it on in BIOS, too
– add below lines into /etc/rc.local for boot-up adaptation

sudo echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
sudo echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
sudo echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
sudo echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

# check the current CPU frequency
sudo apt-get install cpufrequtils
sudo cpufreq-info
# or
apt-get install linux-tools-common
sudo cpupower frequency-info

  • according to your CPU-using policy, limit irq delivery to predetermined cores

for example, if you use core0 to serve host OS and other cores to VNFs

sudo echo 1 > /proc/irq/default_smp_affinity

  • turn off irqbalancing
sudo service irqbalance stop
sudo systemctl disable irqbalance

  • turn off KSM and hugepage defragmentation
sudo echo 0 > /sys/kernel/mm/ksm/run
sudo echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
sudo echo never > /sys/kernel/mm/transparent_hugepage/defrag
sudo echo never > /sys/kernel/mm/transparent_hugepage/enabled

  • disable NMI watchdog interrupt
sudo echo 0 > /proc/sys/kernel/nmi_watchdog

be careful when you decided to disable NMI watchdog since it prevents kernel from detecting system hung status, thus kernel panic routine cannot be invoked.

Leave a Reply

Your email address will not be published. Required fields are marked *