Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo echo "zram" > /etc/modules-load.d/zram.conf
- sudo echo "zram num_devices=4" > /etc/modprobe.d/zram.conf
- Edit /etc/systemd/system/zram.service
- add
- [Unit]
- Description=Swap with zram
- After=multi-user.target
- [Service]
- Type=oneshot
- RemainAfterExit=true
- ExecStartPre=zramctl -f -s 2500MiB -a lz4
- ExecStartPre=/sbin/mkswap /dev/zram0
- ExecStart=/sbin/swapon /dev/zram0
- ExecStop=/sbin/swapoff /dev/zram0
- [Install]
- WantedBy=multi-user.target
- Save and close
- Then sudo systemctl enable zram
- And then add to /etc/sysctl.conf
- vm.vfs_cache_pressure=500
- vm.swappiness=100
- vm.dirty_background_ratio=1
- vm.dirty_ratio=50
- Save and reboot.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement