114
submitted 6 days ago* (last edited 6 days ago) by Die4Ever@retrolemmy.com to c/linux@programming.dev

The graph is on a logarithmic scale btw

Configuration Before series (ms) With series (ms)
1 vCPU 22.3 (21.6-22.6) 0.97 (0.72-1.4)
8 vCPUs 314 (97-2542) 7.0 (5.0-98)
you are viewing a single comment's thread
view the rest of the comments
[-] Die4Ever@retrolemmy.com 14 points 6 days ago* (last edited 6 days ago)

So it basically makes a fake swap space in your RAM and that section is compressed. Linux still treats it as swap space so it only writes to it when you're low on RAM (or there's better things that could be cached in RAM even when it looks like your RAM is mostly empty it can still cache frequently accessed data from your disk). Zswap tries to store most swap in the compressed section of RAM, but when something doesn't compress well or when there's just too much stuff for RAM, it will write to the swap on disk.

So one would need a huge amount of system RAM to have this work effectively.

No, it's good for all sizes of RAM. If you have really small RAM, Zswap can actually be essential because without it you would be reading/writing to disk swap too much and performance would suffer. Someone got Linux running on a Switch Lite, just 4GB of RAM with full desktop and Steam too, and they said "With only 4 GB of RAM, zswap is basically mandatory here"

I have 32gb RAM and practically never fill it up when playing a game, usually.

Zswap would probably still improve performance for you, but it might not be a noticeable difference. But it will reduce your SSD writes, so that's nice to improve SSD lifetime a bit.

This is a very technical article about zRAM and Zswap https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html (I think his tone is overly harsh on zRAM, zRAM can be great if the computer has a slow spinning rust hard drive)

a little less technical https://easylinuxtipsproject.blogspot.com/p/speed-mint.html#ID2

[-] thingsiplay@lemmy.ml 4 points 6 days ago

Thanks that is a bit more enlightening. I'll read the given link and other source today, to get more into. Especially if it helps avoiding writes to SSD, as I got burned very hard from wearing down SSD (it was a software bug that lead to it). I guess the performance difference and the amount it saves from SSD rewrites shouldn't be too much to be worried about, but it bugged me so much that I will take this into consideration nonetheless.

Guess I learned something new today. :-)

[-] victorz@lemmy.world 3 points 6 days ago

But it will reduce your SSD writes, so that's nice to improve SSD lifetime a bit.

This, assuming you have a swap partition, right? I'm running with 64 GB without any swap. No issues while gaming AAA titles. Without swap there should be no wear on the SSD, right?

[-] thingsiplay@lemmy.ml 4 points 6 days ago

Here is an article In defence of swap: common misconceptions by Chris Down from 2018. It has a "tl;dr" section with 7 points, if you just want have a quick look.

I setup a swap file instead a partition, it's just more flexible, but same concept. The swappiness settings cat /proc/sys/vm/swappiness is at "60" with a total size of 64 GiB on a very fast NVME SSD. If this was a slow HDD, then any writes and reads would be much more noticeably slow. I had it disabled in the past too and didn't notice any difference. The only difference to me would be, if the system RAM fills up, then the system could freeze and maybe crash. Or the system will unload applications to make room, and it could hit randomly an important app. Imagine a program has a memory leak.

[-] Die4Ever@retrolemmy.com 4 points 6 days ago* (last edited 6 days ago)

If you really don't want any swap then you can use zRAM. I've heard even just a little bit of swap space (even zRAM) can help a lot. Note that when you set up zRAM, if you set it to 16GB that does not mean it will cap at 16GB of RAM usage, it means it will cap at 16GB of data pre-compression and its actual RAM usage will likely be closer to 6GB when full. And when it's empty it doesn't use any RAM.

[-] victorz@lemmy.world 1 points 6 days ago

That sounds great. I'll keep that in mind when I reach the point where my large RAM size becomes obsolete. ๐Ÿ™

[-] fozid@lem.radiantfig.fyi 2 points 6 days ago

Gaming isn't heavy on ram. You need fast ram not lots of ram for gaming. Lots of ram helps with heavy workloads, compiling and software development and stuff. Playing a game only needs the recommended amount for that game, then as fast as you can get so as not to be a bottleneck for your CPU.

[-] victorz@lemmy.world 1 points 6 days ago

Alright, well, that's not really addressing the question. Without a swap partition, you shouldn't get much wear on your SSD, right?

[-] fozid@lem.radiantfig.fyi 2 points 6 days ago

Sorry, I may have misunderstood. No, if you don't use your SSD as a swap device, you won't use or wear your SSD with swap. With 64gb ram and just playing AAA games, you won't have much need for any kind of swap. If you decide to do any heavy workloads that are heavy on ram requirements, zswap is an option to keep swap off your SSD and thus prevent wear on the disk. However if you are very limited on ram for your workload, zswap might not provide enough space, then traditional SSD swap will be the final option.

[-] victorz@lemmy.world 2 points 5 days ago

Okay cool, thank you ๐Ÿ˜Š๐Ÿ™

Sorry

No worries, I think maybe I came off a little bit annoyed, which I assure you I wasn't. ๐Ÿ˜

this post was submitted on 07 Oct 2026
114 points (100.0% liked)

Linux

15192 readers
212 users here now

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

founded 3 years ago
MODERATORS