Zorin OS zswap performance improvement

If you have your zswap-backing swap partition on a SSD, you'll want your swappiness value to be low regardless... you don't want to cause bit-burnout of the SSD by writing to it too much. It is not recommended to have your swap partition (or swap file) on a SSD.

If you have your zswap-backing swap partition on a fast spinning-rust drive (and most especially on a drive array or SLOG-backed ZFS setup), you'll want your swappiness value to be high... in this case you can push it all the way up to 200... it'll consider the I/O cost of swapping to be lower than the I/O cost of filesystem paging, so when you've hit your highwater mark for memory usage which triggers swapping or paging, it'll preferentially swap rather than page... and since your zswap is compressed and held in memory (until it fills up, then it's LRU-swapped to a drive), that keeps your system speed high and can significantly increase the perceived amount of memory the system has available to use.

https://forum.zorin.com/t/swap-swappiness-explained/26535/2

It should be noted that those running ZFS (Zettabyte File System) don't need to use zswap... the ZFS ARC (Adaptive Replacement Cache) is compressed and held in memory just as zswap is. That's why I can run with as little as 1.2 GB of memory used (if I turn off my ARC preload code, which preloads files to the ARC so accessing them later is faster).

1 Like