-
looking to use Zram as priority 1 and a Physical swap as lower as Zram seems to fill up swap quickly. Im looking at creating the following swaps at boot. Currently, zram remains persistent but loses the /swapfile on reboot. How can i do this as tstab gets overwritten at boot? NAME TYPE SIZE USED PRIO |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
A zram swap has always higher priority than a disk swap. The kernel is smart enough to assume this is always wanted 😎.
It does not get overwritten at boot, at least it should not 🤔. In theory if there is some I/O error or the shutdown is unclean, cutting power before changes from write buffer are synced to disk, this may cause small changes to be lost. Verify once again that both are in |
Beta Was this translation helpful? Give feedback.
-
Thanks got it to work via https://github.com/foundObjects/zram-swap Although the script didn't set zram swap size correctly easy fix, and used dietpi-manager to set normal swap now have NAME TYPE SIZE USED PRIO Works as it should and has lz4 compression which is meant to work best for SBC. Before was using command /boot/dietpi/func/dietpi-set_swapfile the script seems to have set things up better. Using vm.swappiness = 20 Pi4B 4GB. Dietpi has made this little thing a beast ! |
Beta Was this translation helpful? Give feedback.
Sounds unreasonable to me indeed. Any swap usage slows down the system so I'd always recommend
1
as lowest possible number. Some say that if rarely used data is swapped, there is more space for filesystem cache to speed up file reads for those cached ones. But I think the chance that some files which are read a few times during some process are needed later is often lower than the chance that data from a process which is hold in RAM are needed later. And often performance is not the only relevant aspect but disk wear as well.As you have zram + disk swap working now, not much need to change it. But for completeness, if you want to test …