Add docs on how to move swap to zram

This commit is contained in:
KemoNine 2020-08-10 22:20:51 -04:00
parent 36a3116516
commit b665f88e3d
1 changed files with 31 additions and 0 deletions

View File

@ -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