Add docs on how to move swap to zram
This commit is contained in:
parent
36a3116516
commit
b665f88e3d
31
docs/swap.md
31
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
|
||||
|
|
Loading…
Reference in a new issue