Using KSM in proxmox nodes, but and inside of the VM?

Oct 11, 2020
35
2
13
37
KSM is an excellent feature to reduce de memory page and I use it with Proxmox and it works really well. Usually the VM does not has KSM enabled, so I am wondering if setup a KSM inside of VM can help reduce the memory usage or it will make KSM under proxmox node less efficient or it will not change anything. I am not sure about how much the Proxmox node kernel can be efficient with VM resources.

have anyone did the same question and tested something?
 
Hi,
to make sure i understand this correctly:
You want to enable KSM inside of a VM?

I don't think this is necessary. KSM operates on pages in memory (a page is 4096 bytes) [1]. If KSM is working on your host it scans a number of pages and tries to find duplicated pages. It does this for all the memory on that machine.
If you enable it inside the VM I would guess it would be a higher work load for the system since it has to do the same thing twice. It could reduce memory usage inside your VM, but with KSM running you could just give it more memory.

I hope that makes it a bit clearer :).

[1] https://pve.proxmox.com/wiki/Dynamic_Memory_Management#KSM