Skip to content

Instantly share code, notes, and snippets.

@AnatomicJC
Forked from mapuo/debian_ksm.md
Created September 23, 2019 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnatomicJC/e7b922aaed0e65b5d767b9a90aaf8500 to your computer and use it in GitHub Desktop.
Save AnatomicJC/e7b922aaed0e65b5d767b9a90aaf8500 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 running Netdata on my Debian based home server and I wanted to enable KSM after Netdata installer suggested it cloud 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment