KSM: Difference between revisions
No edit summary |
No edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
#REDIRECT [[Dynamic Memory Management]] | |||
Outdated, see [[Dynamic Memory Management]] | |||
=Introduction= | =Introduction= | ||
Beginning with Proxmox VE 1.5 (only with Kernel 2.6. | Beginning with Proxmox VE 1.5 (only with Kernel 2.6.35 and higher), Proxmox VE uses KSM (Kernel Samepage Merging). Since Proxmox VE 1.9, it also works with the default 2.6.32 Kernel branch. | ||
KSM is running in the Linux kernel scanning the memory of all the virtual machines running on a single host, looking for duplication and consolidating. With KSM we're able to improve virtual machine density by as much as 300% without impacting performance. One of the great benefits of using Linux as the hypervisor means KSM is not limited to KVM and virtual machines, but can also reduce memory pressure with normal Linux applications. | KSM is running in the Linux kernel scanning the memory of all the virtual machines running on a single host, looking for duplication and consolidating. With KSM we're able to improve virtual machine density by as much as 300% without impacting performance. One of the great benefits of using Linux as the hypervisor means KSM is not limited to KVM and virtual machines, but can also reduce memory pressure with normal Linux applications. | ||
Line 7: | Line 11: | ||
Just run the 2.6.32 kernel branch, see [[Proxmox_VE_Kernel]] | Just run the 2.6.32 kernel branch, see [[Proxmox_VE_Kernel]] | ||
Check packages version with '''pveversion -''' (all versions should be equal or higher): | Check packages version with '''pveversion -v''' (all versions should be equal or higher): | ||
<pre>pveversion -v | <pre>pveversion -v | ||
pve-manager: 1. | pve-manager: 1.9-24 (pve-manager/1.9/6542) | ||
running kernel: 2.6.32- | running kernel: 2.6.32-6-pve | ||
proxmox-ve-2.6.32: 1. | proxmox-ve-2.6.32: 1.9-43 | ||
pve-kernel-2.6.32- | pve-kernel-2.6.32-6-pve: 2.6.32-43 | ||
qemu-server: 1.1- | qemu-server: 1.1-32 | ||
pve-firmware: 1.0- | pve-firmware: 1.0-13 | ||
libpve-storage-perl: 1.0- | libpve-storage-perl: 1.0-19 | ||
vncterm: 0.9-2 | vncterm: 0.9-2 | ||
vzctl: 3.0. | vzctl: 3.0.28-1pve5 | ||
vzdump: 1.2- | vzdump: 1.2-15 | ||
vzprocps: 2.0.11- | vzprocps: 2.0.11-2 | ||
vzquota: 3.0.11-1 | vzquota: 3.0.11-1 | ||
pve-qemu-kvm: 0. | pve-qemu-kvm: 0.15.0-1 | ||
ksm-control-daemon: 1.0- | ksm-control-daemon: 1.0-6 | ||
</pre> | |||
=KSM in action= | =KSM in action= | ||
Just install several KVM virtual machines with the same OS (using at least | Just install several KVM virtual machines with the same OS (using at least 80% of your physical memory on the host) and wait a few minutes. you will notice higher CPU activities on the host (ksm daemon) and the used memory on the host will be lowered significantly (see start page showing the overall memory usage). | ||
Howto verify that KSM is working (how many pages are being shared between your KVM guests): | |||
<pre>watch cat /sys/kernel/mm/ksm/pages_sharing</pre> | |||
Note: a page is 4096 bytes | |||
=Links= | =Links= | ||
[[Memory Ballooning]] | [[Memory Ballooning]] | ||
[[Category: HOWTO | [[Category: HOWTO]] |
Latest revision as of 13:17, 24 May 2017
Redirect to:
Outdated, see Dynamic Memory Management
Introduction
Beginning with Proxmox VE 1.5 (only with Kernel 2.6.35 and higher), Proxmox VE uses KSM (Kernel Samepage Merging). Since Proxmox VE 1.9, it also works with the default 2.6.32 Kernel branch.
KSM is running in the Linux kernel scanning the memory of all the virtual machines running on a single host, looking for duplication and consolidating. With KSM we're able to improve virtual machine density by as much as 300% without impacting performance. One of the great benefits of using Linux as the hypervisor means KSM is not limited to KVM and virtual machines, but can also reduce memory pressure with normal Linux applications.
Howto enable KSM
Just run the 2.6.32 kernel branch, see Proxmox_VE_Kernel
Check packages version with pveversion -v (all versions should be equal or higher):
pveversion -v pve-manager: 1.9-24 (pve-manager/1.9/6542) running kernel: 2.6.32-6-pve proxmox-ve-2.6.32: 1.9-43 pve-kernel-2.6.32-6-pve: 2.6.32-43 qemu-server: 1.1-32 pve-firmware: 1.0-13 libpve-storage-perl: 1.0-19 vncterm: 0.9-2 vzctl: 3.0.28-1pve5 vzdump: 1.2-15 vzprocps: 2.0.11-2 vzquota: 3.0.11-1 pve-qemu-kvm: 0.15.0-1 ksm-control-daemon: 1.0-6
KSM in action
Just install several KVM virtual machines with the same OS (using at least 80% of your physical memory on the host) and wait a few minutes. you will notice higher CPU activities on the host (ksm daemon) and the used memory on the host will be lowered significantly (see start page showing the overall memory usage).
Howto verify that KSM is working (how many pages are being shared between your KVM guests):
watch cat /sys/kernel/mm/ksm/pages_sharing
Note: a page is 4096 bytes