09-16-2020, 09:49 AM
(This post was last modified: 09-16-2020, 10:05 AM by wd5gnr.
Edit Reason: Forgot to remind you to do chmod
)
(09-16-2020, 06:17 AM)peperjohnny Wrote: Thanks for the tip. Plasma desktop got a bit faster with that.
My current configuration seems to be OK, but not sure if it is really better or not. I have a pretty large SDcard mounted in /etc/fstab as /sdcard
The following as root:
dd if=/dev/zero of=/swapfile bs=1MiB count=1024
mkswap /swapfile
# note you will need /sdcard mounted first:
dd if=/dev/zero of=/sdcard/swapfile bs=1MiB count=4096
mkswap /sdcard/swapfile
#oops forgot these:
chmod 600 /swapfile /sdcard/swapfile
Then in /etc/fstab:
/dev/mmcblk0p1 /sdcard ext4 rw,relatime,nofail
/swapfile swap swap pri=50 0 0
/sdcard/swapfile swap swap pri=0 0 0
Combined with the ZRAM swap at priority 100, this gives you a 1G swap on the eMMC and 4G of (presumably) slower swap on the SDCard.
If you don't want to reboot, do (as root):
swapon -a
Verify with:
swapon -s
I have left vm.swappiness at 60 but it might do to turn it higher to make more RAM available for caching.
sysctl -w vm.swappiness=90
Make that permanent in /etc/sysctl.conf or sysctl.d
But like I say, I've left it at 60 to see how it does for a bit.
By the way, you can't use fallocate. It leaves a sparse file which will not mount.