From b665f88e3dd4a930903dbd2e6416e01eb9429b96 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Mon, 10 Aug 2020 22:20:51 -0400 Subject: [PATCH] Add docs on how to move swap to zram --- docs/swap.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/swap.md b/docs/swap.md index 552c211..43e79cc 100644 --- a/docs/swap.md +++ b/docs/swap.md @@ -1,5 +1,36 @@ # swap +## zram swap config + +*Please Note: This sets up a zram swap config. It uses RAM for swap. You should be able to use this if you have >=2Gb of RAM, be sure to keep an eye on your RAM use over time just in case this causes problems. See the munin docs for details on how to monitor RAM use over time.* + +The below will setup 5% of the system memory as zram backed swap. + +``` sh + +sudo -sHu root +git clone https://github.com/StuartIanNaylor/zram-swap-config /opt/zram-swap-config +cd /opt/zram-swap-config +chmod +x install.sh +./install.sh + +nano -w /etc/zram-swap-config.conf +MEM_FACTOR=5 +SWAPPINESS=1 + +systemctl reboot + +sudo -sHu root +zramctl +cat /proc/sys/vm/swappiness +htop / top to see swap is available + +``` + +## Standard swap file + +*Please Note: This sets up a standard swap file and can cause your sd card to wear out faster* + The below commands will setup 1Gb of swap space as a file on the root filesystem and activate it for use. ``` sh