I am considering to add swap to my FreedomBox. The 512 MB (LIME) are a bit thin for all the applications I am running and I think the occasional freezes are due to this topic. I used zram in the past which improved the situation a lot but want to use swap to try.
There is this nice tutorial: https://wiki.debian.org/Swap
So I am considering
- own partition
- using external USB memory
- swap file
Swap file looks like the simplest to implement. There is plenty of space on my 32 GB µSD card.
Has anyone tried this and can share his experience?
So I am now experimenting with a 2GB USB stick. Swappiness set to 25, maybe I will even lower it to 10. Still temporarily, so all set up via cockpit without changes to fstab etc. I will report the outcome here
After having read a lot about swappiness, I think it need not be tweaked at all. So I set it to the default value of 60, without any visible change.
During the last 3 days the box worked flawlessly. It survived an upgrade of freedombox (to version 20.0), which often was a cause for a freeze. The other cause was often an update of apache, so I will observe the behaviour during the days to come.
Current memory consumption:
- mem: total = 491 MB / used = 249 MB / free = 11 MB / shared = 27 MB / buff/cache = 231 MB / available = 204 MB
- Swap: total = 1900 MB / used = 201 MB / free = 1699 MB
Please see my last comment on this issue:
I strongly encourage to have SWAP on these low memory devices. It makes the device faster and more reliable.