roles/vmhost: Enable KSM

This commit adds a systemd unit to enable the Kernel Same-page Merging
daemon on VM hosts. This allows much greater virtual machine density,
especially when many VMs are running the same guest OS.
This commit is contained in:
2019-03-22 09:25:48 -05:00
parent 909c8e7a03
commit 7e585445b9
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# vim: set ft=dosini :
[Unit]
Description=Kernel Same-Page Merging
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c "echo 1 > /sys/kernel/mm/ksm/run"
ExecStop=/bin/sh -c "echo 0 > /sys/kernel/mm/ksm/run"
[Install]
WantedBy=multi-user.target