Hi, I was scrolling through the debian wiki and suddenly found out about zram and zswap. I have an 8gb swap partition (recommended size by the linux community when I used to have 3gb ram). I was just wondering if I should stick with zswap or use zram OR both. Will there be any performance improvement when using both? If not, then which one should I use?
output of inxi -Fxxxxz
Thanks for the posts, but I am still confused after going through the posts about which to use for specifically for me, I have 4GB of ram with 8GB swap partition on an SSD 512GB. My vm.swappiness value is set to 10.
I generally use browsers and sometimes VS Code to code in python.
I don't know if I should keep the swap partition, or reduce it, or just use zram and stop using swap completely.
As I have read from your posts, I see that zram is better for general use or so.
As far as my understanding goes, I think that using zram is obvious due to better performance than disk-based swap. But if I want to use swap just in case if my system needs it then should I not use zswap to manage the swap memory a little bit better? The idea is to use zram but keep zswap with a swap partition as a backup?
GroudonandKyogre wrote: 2025-02-04 09:55
zswap with a swap partition
As far as over thinking goes, I'd leave your existing swap since it's already there. I would also raise swappiness or even restore to default. There are past discussions to browse on that topic also.
As I remember that system may top out at 8GB? Maybe upgrade that?
GroudonandKyogre wrote: 2025-02-04 09:55
zswap with a swap partition
As far as over thinking goes, I'd leave your existing swap since it's already there. I would also raise swappiness or even restore to default. There are past discussions to browse on that topic also.
As I remember that system may top out at 8GB? Maybe upgrade that?
First,I liked that "As far as overthinking goes!"
Second, As I had searched a value of 10 (or 20) is optimal for my system.
Third, No, my system is already topped up at the max, this mobo only supports DDR2 and as I know it, the limit of DDR2 is 4GB with 2 sticks.
Conclusion- So I should use both of them at the same time? Will they conflict?
GroudonandKyogre wrote: 2025-02-04 16:15
"As far as overthinking goes!"
I support one run through it all, after that it's rumination!
GroudonandKyogre wrote: 2025-02-04 16:15
As I had searched a value of 10 (or 20) is optimal for my system.
In a period correct view, your lowered swappiness is what an advanced user would do. With the advent of zram for swap, pulling more into swap while compressing will increase available memory. So my current thinking is to increase swap activity. The limiting factor for this use in older computers may be the extra hit on the processor now with compression duty, which is still faster than a disk.
CwF wrote: 2025-02-04 17:10Yes, no conflict. They are prioritized.
No real-world experience here so I'm asking as well as sharing but wouldn't that priority require zswap to be full before moving to disk-based swap? Reason I ask is because zswap will move stale pages from zram to disk-based swap and might use less physical RAM.
edit: Overthinking myself, zram would be compressed so this might not be worth exploring as it wouldn't recover all that much RAM.
we see things not as they are, but as we are.
-- anais nin
You would think, but when I ran both on a 64GB box I did see both in use without the zram maxed out. As I remember once there was something on the swap partition it is ‘stickier’, zram would clear out first. I assumed it did max the zram briefly and I didn't notice. Even now I see 129.5MB of 25.4GB zswap in use with 73GB “free”, so never go without any swap, but eventually I did eliminate partition based swap and never really considered file based swap.
wizard10000 wrote: 2025-02-04 17:42
zram would be compressed so this might not be worth exploring as it wouldn't recover all that much RAM.
...about 2:1 up to 5:1. So that 129.5 of mine could represent up to a half gig saved. wohoo!
After all of this, I came to the conclusion of using my current system configuration but with higher swappiness value of 20 and with both of them.
Thanks,
GK