114
New Patches For Linux's Zswap Show Major Improvements
(www.phoronix.com)
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
In terms of performance, you actually don't want to avoid swapping, you want your OS to be smart about swapping. Some type of swap space is probably always beneficial unless you have more RAM than storage lol. Swap is great for putting aside data that isn't needed but can't be freed, and prioritizing filesystem cache over some background service that isn't doing anything. Even big servers often use some form of swap because swap can reduce disk reading. In some cases swap can even reduce disk writing, as counter intuitive as that sounds.
Yea both zRAM and Zswap use good compression, typically around 3:1 ratio, and it's still light on CPU usage, much faster than SSD swap.
I remember when I used to have swap enabled. It used to be very slow, back in the days when we used swap in mechanical drives. The computer would just freeze for a second while swapping, lol.
So I'm having some trouble wrapping my head around why swapping would not be something you want to avoid—why it would be beneficial for performance. If you can prevent the need for swapping, that's the best outcome, surely? The only solution to which would be to have enough pure RAM installed in the system.
But I think I get you? You mean you "want" to swap when the memory runs out?
It's more complicated than that. If stuff in your disk needs faster access than old unused stuff in memory, swap can make the swap so that the stuff in your disk is cached better in memory. If you were able to cache your entire filesystem into RAM then your computer would be faster, but people don't have that much RAM.