Monday, August 24, 2015

Optimize Host system for KVM

The company asked me to start with KVM. Again, I faced with so many performance problem that lead system unresponsible, crash, disconnect...

The problem is host's config was not configured optimize for KVM.
I have tried many kind of config and below was optimized for me:


 /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=cfq transparent_hugepage=never"
Khugepage:
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag

/etc/sysctrl.conf
vm.swappiness=1
vm.dirty_background_ratio=5
vm.dirty_ratio=60
vm.nr_hugepages=5000 (5000x2 = 10GB ram dedicated for KVM)

 /etc/libvirt/qemu/* (guest config)
<memoryBacking>
<hugepages/>
</memoryBacking>
That's all, work great for me.

No comments:

Post a Comment