Why and how to extend ZRAM on L5. A revolution for Librem 5 stability!

I just run the script. You were right ! Amazing boost in performance compared with only swap file. Even scrolling feels blazing fast .Now i have 8,2 Gb. I guess its the total of the extended swap and the 5 gb of zram. Can this cause any issue because of the extra swap ? Have you noticed any downsides such as more battery drain ?

2 Likes

6.1GB does fine on my end.

2 Likes

Any increase in battery drain ?

1 Like

For me, switch swap file 2g and zram 4g the phone is still laggy.

1 Like

Today I got zram service to start error message while running the script

1 Like

FWIW you may want to remove this kind of scripts from your phones to not conflict with configuration that’s coming in librem5-base-defaults 66pureos1~byz3 (or 68pureos1 in crimson).

9 Likes

I will keep mine,last base-defaults upgrade I just re-did it when the defaults took out my ZRAM config.

1 Like

A new patch is coming that’s supposed to give a 50% efficiency boost, which would be nice. I hope someone tests this to get some comparison data. From Phoronix:

The Linux ZRAM module for creating compressed block devices in RAM could be on the edge of a nice I/O compression performance boost.

Gao Xu of the HONOR company posted a patch to the Linux kernel mailing list for optimizing the LZ4 dictionary compression performance with ZRAM. According to the engineer, the few dozen lines of code patch can improve the dictionary compression performance by over 50% in ZRAM I/O tests.

2 Likes

Note that we’re currently using lzo-rle by default, not lz4. This also seems to only affect the case when a dictionary is being used, which IIUC was artificially slowed down by what’s being fixed in this patch, so you won’t get any speedup if you weren’t using a custom dictionary already anyway.

1 Like

Adding swap is also a great way to get by on a super minimal cheap 1 CPU core VPS server, when your ram is limited(500MB) add swap(~1GB), when virtual disk space is limited(20GB where system + swap=30%) you can supplement it with a rsync mounted slower cloud storage service. These tricks have gotten me outstanding utility from a very limited very cheap ‘privacy’ VPS. It also applies to limited inexpensive single board computers similar to R-pi.
Back in the Maemo5/Nokia N900 days of 256MB of RAM there were many tweaks to swap including moving it to SD card as that Linux phone also benefited greatly by tweaking the various swap settings in addition to just how many MB.