You are not logged in.

#1 2024-09-11 14:02:36

sniper-kun_2
Member
Registered: 2024-01-25
Posts: 5

zswap vs zram

Hello there, what do you fine gents prefer/is more suitable to your needs between swap+zswap or zram? I'm currently using zram via systemd-zram-generator but it's mostly because this laptop only got 64GB of storage so I need all the space I can get out of this thing. Lemme see what you guys use (I know a lot of people don't bother with swap stuff but I do)

Some useful resources:
https://wiki.debian.org/Zswap
https://wiki.debian.org/ZRam
https://wiki.archlinux.org/title/Zswap
https://wiki.archlinux.org/title/Zram
https://wiki.gentoo.org/wiki/Zswap
https://wiki.gentoo.org/wiki/Zram
https://docs.kernel.org/admin-guide/mm/zswap.html
https://docs.kernel.org/admin-guide/blockdev/zram.html

Can't post links yikes

(activated the links, johnraff)

Last edited by johnraff (2024-09-14 01:45:34)

Offline

#2 2024-09-11 15:51:59

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,144

Re: zswap vs zram

Nope, can't post links until a certain number of posts.

It's a learning who you are period.
I don't use swap.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#3 2024-09-11 16:46:39

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,780
Website

Re: zswap vs zram

It's OK, you can still figure the links out. I fixed the first two. I have a swap partition, it barely gets used.


I don't care what you do at home. Would you care to explain?

Offline

#4 2024-09-12 20:18:09

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,144

Re: zswap vs zram

hhh wrote:

It's OK, you can still figure the links out. I fixed the first two. I have a swap partition, it barely gets used.

I stopped setting them up as they never get used.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#5 2024-09-12 20:40:49

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 1,146

Re: zswap vs zram

I have swap partitions on my installs, partly to enable hibernation, & partly because I routinely run virtual machines which eat RAM, consequently on most of my installs swap gets at least some use just about as soon as I have everything booted up.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#6 2024-09-13 01:46:01

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 13,141
Website

Re: zswap vs zram

Bearded_Blunder wrote:

I have swap partitions on my installs... partly because I routinely run virtual machines which eat RAM

Me too. I have 8GB of RAM (used to seem like a lot) which can get used up running a VM along with other work. And as for two VMs at once...

OT/ I like to run an under-powered machine though - make sure BL isn't only for the top-of-the-line machines.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#7 2024-09-13 12:21:34

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,144

Re: zswap vs zram

Actually I do have a swap partition - 15GB (14.9)
Did not remember it at all but just saw it in gparted.
- 16GB RAM and
- 1TB HDD

Last edited by Sector11 (2024-09-14 21:26:51)


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#8 2024-09-13 21:54:23

Zepher
Banned
From: Kentucky, USA
Registered: 2024-06-17
Posts: 245

Re: zswap vs zram

I suppose it really depends upon how you use your device and it's hardware. I personally haven't used swap for many years but I'm fortunate enough to have mid-higher hardware for desktop and laptop. Having said that, I don't game or run VM's but use my devices for communication, general web stuff and commerce. Again, like nearly anything Linux... It's all about what's right for you.


'The Universe is under no obligation to make sense to you'

Offline

#9 2024-09-13 22:09:05

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 1,146

Re: zswap vs zram

My other reason for swap is the UPS, I'd rather that hibernated everything in the event of an outage than it forcing a shutdown closing programs & potentially losing unsaved work.

But it's entirely down to how a system is used if you need swap space & how much.

If asked, I always recommend enough for hibernation with laptops though, just so you've the option in the case of low battery.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#10 2024-09-14 01:38:21

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 13,141
Website

Re: zswap vs zram

Bearded_Blunder wrote:

If asked, I always recommend enough for hibernation with laptops though, just so you've the option in the case of low battery.

Makes sense.

Back to OP though, does anyone have experience or advice about whether to enable zswap or not?
(I'm going to move my swap partition from the hard disk to the ssd one of these days.)

Last edited by johnraff (2024-09-14 01:40:47)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#11 2024-09-14 04:14:47

Zepher
Banned
From: Kentucky, USA
Registered: 2024-06-17
Posts: 245

Re: zswap vs zram

@johnraff and @OP, it depends upon what the OP's system specs are and how they intend to use their machine. All we know is their storage capacity, nothing else.


'The Universe is under no obligation to make sense to you'

Offline

#12 2024-09-14 12:12:18

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 1,146

Re: zswap vs zram

johnraff wrote:

Back to OP though, does anyone have experience or advice about whether to enable zswap or not?

Afraid not, I've run across Windows equivalent things, which slowed the system down for no appreciable benefit, so I'm not excited by them.

Can't even give meaningful rule of thumb type answers about swap settings without knowing how much ram the OP's system has though.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

#13 2024-09-15 20:37:37

sniper-kun_2
Member
Registered: 2024-01-25
Posts: 5

Re: zswap vs zram

I was curious about you guys preference, not asking for myself really.
Personally I find zram to be the most efficient for my needs. On my lower-end laptop with 4GB ram it's pretty much essential (I have Slackware on it and building stuff from SBO can turn it into a turtle) but I use it even on the one with 24GB of ram just to be sure. I haven't experienced any drawbacks in terms of stability and/or performance, au contraire.

johnraff wrote:

Back to OP though, does anyone have experience or advice about whether to enable zswap or not?
(I'm going to move my swap partition from the hard disk to the ssd one of these days.)

I think swap partition + zswap is the way to go nowadays, I say you should try it. Actually I think I'm going to do the same once I reinstall Debian, just to see how it performs and such.

Thank you for making the links in the OP clickable, I wasn't really bothered by it but I wanted you guys to access the resources easily. big_smile

Offline

#14 2024-09-16 05:57:02

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 13,141
Website

Re: zswap vs zram

^You should be able to post links now anyway.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB