Skip to content

Instantly share code, notes, and snippets.

@mapuo
Last active July 17, 2024 08:06
Show Gist options
  • Save mapuo/17e3b253222172c1659782eb14150c3a to your computer and use it in GitHub Desktop.
Save mapuo/17e3b253222172c1659782eb14150c3a to your computer and use it in GitHub Desktop.
Enable KSM (Kernel Same-Page Merging) on boot in Debian

Enable KSM (Kernel Same-Page Merging) on boot in Debian

I have installed and run Netdata on my Debian based home server and I wanted to enable KSM after Netdata installer suggested it could save some RAM.

To enable the KSM on boot in Debian you I executed these steps:

  1. Install ksmtuned without all the QEMU dependencies:
sudo apt-get install ksmtuned --no-install-recommends
  1. I actually don't need the ksmtuned.service and I did disabled it:
sudo systemctl stop ksmtuned.service
sudo systemctl disable ksmtuned.service
  1. Finally if:
sudo cat /sys/kernel/mm/ksm/run

returns 0 restart the ksm.service:

sudo systemctl restart ksm.service
@malcolm-white-dti
Copy link

Has it been enabled in the kernel that you are running?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment