Request for Fedora users with 8GB of RAM — is zram helping you?

Hey, Fedora users with laptops with 8GB of RAM — I’m curious if our new compressed-ram default is helping you. After you have been running for a long time and have lots of browser tabs open and other apps running (like normal daily use for several days), can you please run

/sbin/zramctl

and post the results? Thanks!

If you’re running something other than GNOME, note that too please.

7 Likes

I’m on 16 GB, so I may not offer perfect insight, but when doing heavy virtualization tasks zram can really help, and is noticeably faster than swap. Besides that, I haven’t really noticed it :man_shrugging:

For clarity: Its biggest upside has been giving like 12 Gigs to a VM to compile something or whatever, and accidentally opening to many Firefox tabs. The slowdown is usually more graceful, and easier to remedy with zram.

2 Likes

Hi, I am using a 8gb machine but as I understand fedora doesnt make much use of ram. A gnome extension for cpu and mem usage shows about 16-20% use of ram even if cpu hits red. At my second pc with 16gb I get the same. Is dual boot and w10 show about 20% use of ram at all situtations and fc33 shows no more 20% use of ram. Maybe I dont get something but how to check the improvment of zram?

1 Like

Oh, sorry! Run /sbin/zramctl to see utilization. That was supposed to be in my original post but got lost somehow. I’ve edited it in now.

2 Likes

This is what I get after about a day:
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle 3,8G 4K 74B 12K 4 [SWAP]

after some videoconferencing and other things:
/dev/zram0 lzo-rle 3,8G 192K 14,2K 160K 4 [SWAP]

later the same day:
/dev/zram0 lzo-rle 3,8G 1,2M 191,8K 392K 4 [SWAP]

with two videos playing at the same time:
/dev/zram0 lzo-rle 3,8G 3,7M 216,1K 440K 4 [SWAP]

I’ll stop here. My 8G laptop is still working absolutely fine.

2 Likes
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle         4G   4K   74B   12K       8 [SWAP]

not a laptop, and with 16 GB

2 Likes

Matt,

Here’s mine on an 8GB system:

NAME       ALGORITHM DISKSIZE  DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle       3.8G  2.7M  673K  1.3M       4 [SWAP]
3 Likes

8GB laptop. This is at the end of a work day: a lot of open terminals, Firefox, DBeaver, Telegram, Evolution.

NAME       ALGORITHM DISKSIZE  DATA  COMPR  TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle       3.7G  2.6G 842.7M 876.1M       4 [SWAP]
3 Likes

I don’t use my 8GB laptop enough to run into ram issues, but I recently filled up the ram and (4GB) zram swap on my 32GB system. It slowed down and nearly locked up at some point, probably due to heavy I/O when an automated borg backup started running, but never crashed. If I come across a similar situation again, I’ll post the results of /sbin/zramctl.

Previously with Ubuntu I would normally have weeks of uptime, rebooting around once a month. With Fedora having more frequent kernel updates, I typically go 7-10 days between reboots. Sometimes there are more than one kernel and software updates installed requiring reboots in that timeframe.

2 Likes

Thanks everyone! Next thing: if you found your zram swap to be heavily used, can you follow the steps here to increase the limit (as planned for F34) to see what effect that has?

https://fedoraproject.org/wiki/Changes/Scale_ZRAM_to_full_memory_size#How_To_Test

2 Likes

If in the How_To_Test, can give the full path of conf files to be modified, will be even better for starters.

1 Like

Install the new version of the zram-generator-defaults package

Is this already on Pagure somewhere?

1 Like

Hi,

I’ve just done this test:

$ sudo cp /lib/systemd/zram-generator.conf /etc/systemd/
$ sudo vi /etc/systemd/zram-generator.conf

/etc/systemd//zram-generator.conf:

# This config file enables a /dev/zram0 device with the default settings:
# — size — half of available RAM or 4GB, whichever is less
# — compression — most likely lzo-rle
#
# To disable, uninstall zram-generator-defaults or create empty
# /etc/systemd/zram-generator.conf file.
[zram0]
zram-fraction=1.0
max-zram-size=8192

$ sudo systemctl daemon-reload && sudo systemctl restart swap-create@zram0

$ zramctl
    NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
    /dev/zram0 lzo-rle       7.3G   4K   74B   12K       4 [SWAP]

Seems to work ok to me. Would remove after testing or certainly before updating to F34.

Thanks Tom.

5 Likes

Thanks! Seems to be working fine for me so far. I’ll do some further testing right now.

So, will my ram fill up to 8G (with 16G), then start compressing anything that goes into the next 8G?

Edit: Never mind. It seems to be more like a literal swap partition? Either way, this is pretty cool:

Screenshot from 2021-01-26 18-14-22

And my system, and all the VMs, are all running at near 100%, if not 100% speed!

1 Like

It’s unfortunately much more complicated than that, because code can’t actually run from the compressed space; it has to be swapped in. So, basically when there is memory pressure (which is complicated), code that hasn’t run for a while gets pushed to the compressed area, making more room for active code. But when that now-compressed code needs to do something, it needs to come back out. When this hits disk (even SSD), it’s really, really painful. When it’s all in RAM (as with this feature) it is quite fast, but it’s still not free.

4 Likes

Yeah, going over my head a bit, but still pretty cool!

1 Like

So, it’s basically just swap space but on a ram disk? I misunderstood this completely lol

1 Like

It is exactly that — swap space on a ram disk that is compressed.

4 Likes

Great and Cool!
F34 Test Server - Run and show zramctl…

[root@cosmos simmon]# uname -ar
Linux cosmos 5.11.0-0.rc5.20210128git76c057c84d28.137.fc34.x86_64 #1 SMP Thu Jan 28 21:10:47 UTC       2021 x86_64 x86_64 x86_64 GNU/Linux
[root@cosmos simmon]# zramctl
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle       6.4G   4K   80B   12K       4 [SWAP]

so, it’s a start change something?

1 Like

In this case, not really. There’s only 4K in there. You’ll need to use up some more RAM to see an effect. :slight_smile:

3 Likes