host

numa

1
2
3
4
5
6
yum install numactl
numactl --hardware
numastat
numastat -c qemu-kvm
echo 1 > /proc/sys/kernel/numa_balancing
virsh numatune
1
2
3
4
5
6
virsh vcpuinfo --domain
virsh emulatorpin --domain
virsh emulatorpin --domain domain xx-xx --live
virsh vcpupin --domain domain --vcpu 0 --cuplist 1-2 --live --config
virsh vcpupin --config --domain domain
virsh setvcpus --domain domain --live --config 2 --hotpluggable

KSM

1
echo 0 > /sys/kernel/mm/ksm/merge_across_nodes

nested

1
2
3
4
5
6
7
rmmode kvm_intel
modprobe kvm_intel netsted=1
(cat > /etc/modprobe.d/kvm_mod.conf <<EOF
options kvm_intel nested=y
EOF
)
cat /sys/module/kvm_intel/parameters/nested

VM

cpu

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
virsh vcpuinfo --domain domain
virsh vcpucount --live --domain domain
virsh vcpucount --config --domain domain

virsh setvcpus --domain domain --config --maximum 4
virsh setvcpu --domain domain 1 --config --enable
virsh setvcps --domain domain 1 --config --hotpluggable
virsh start domain


# running
virsh setvcpus --domain domain --live --config 2 --hotpluggable
# linux
virsh setvcpus --domain domain x --live
echo 1 > /sys/devices/system/cpu/cpux/online