How to tune systems to achieve high performance in virtualization circumstances?

Most time, we need to tune system parameters to achieve better performance but what the general parameters to be tuned in Linux systems.

I think you may want to add following parameters to Kernel boot (/etc/default/grub) parameters

intel_idle.max_cstate=0 processor.max_cstate=0 idle=poll intel_pstate=disable

At the same time, you may also want to shutdown/open Pause Loop Exiting (PLE). See [2] [3] for more details about PLE, and see [1] [4] for more details about Intel C-States and P-States.

How to Shutdown PLE:

sudo rmmod kvm_intel
sudo modprobe kvm_intel ple_gap=0 ple_window=0
cat /sys/module/kvm_intel/parameters/ple*

How to turn on PLE:

sudo rmmod kvm_intel
sudo modprobe kvm_intel 
cat /sys/module/kvm_intel/parameters/ple*

References
[1] https://stackoverflow.com/questions/12111954/context-switches-much-slower-in-new-linux-kernels
[2] https://www.google.com/patents/US9021497
[3] https://surriel.com/system/files/riel_t_1620_kvm_performance.pdf
[4] https://haypo.github.io/intel-cpus.html



Answered by harryxiyou.

IDLE=POLL means when vCPU is idle CPU will execute No Op instruction like spin-lock does. This will trigger PLE if PLE is turned on.

Also see https://events.linuxfoundation.org/sites/events/files/slides/LinuxConEurope_2015.pdf for more details about P-States.

Weiwei Jia

Weiwei Jia is a Ph.D. student in the Department of Computer Science at New Jersey Institute of Technology since 2016. His research interests are include storage systems, operating systems and computer systems.

Leave a Reply

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