Ralphxyz
Posts: 45
Joined: Wed Jan 01, 2014 7:20 pm

How to ZRAM?

Sun Apr 07, 2019 3:45 pm

In my other thread about the Pi being unusable for everyday use:

viewtopic.php?f=63&t=237297&p=1451466#p1451466

It was suggested running/using ZRAM to replace memory swapping would help.

I tried: sudo apt-get install zram-config

and get ... Unable to locate package zram-config

So how do I install/use ZRAM or is there something else?

Thanks,

Ralph

User avatar
Void Frost
Posts: 55
Joined: Sun Jul 01, 2018 2:13 am

Re: How to ZRAM?

Sun Apr 07, 2019 6:01 pm

Raspberry Pi User. Subscribe to my YouTube channel, if you want :D https://www.youtube.com/c/VoidFrost

Ralphxyz
Posts: 45
Joined: Wed Jan 01, 2014 7:20 pm

Re: How to ZRAM?

Sun Apr 07, 2019 8:01 pm

I found a script to install ZRAM https://www.novaspirit.com/2016/12/24/i ... pberry-pi/

Now I see this:

[email protected]:~ $ dmesg | grep zram
[ 7.120159] zram: Added device: zram0
[ 7.121023] zram: Added device: zram1
[ 7.122456] zram: Added device: zram2
[ 7.123318] zram: Added device: zram3
[ 7.273994] zram0: detected capacity change from 0 to 243060736
[ 7.372713] Adding 237360k swap on /dev/zram0. Priority:5 extents:1 across:237360k SSFS
[ 7.384271] zram1: detected capacity change from 0 to 243060736
[ 7.414529] Adding 237360k swap on /dev/zram1. Priority:5 extents:1 across:237360k SSFS
[ 7.417586] zram2: detected capacity change from 0 to 243060736
[ 7.453400] Adding 237360k swap on /dev/zram2. Priority:5 extents:1 across:237360k SSFS
[ 7.456655] zram3: detected capacity change from 0 to 243060736
[ 7.497007] Adding 237360k swap on /dev/zram3. Priority:5 extents:1 across:237360k SSFS
[email protected]:~ $ swapon -s
Filename Type Size Used Priority
/dev/zram0 partition 237360 0 5
/dev/zram1 partition 237360 0 5
/dev/zram2 partition 237360 0 5
/dev/zram3 partition 237360 0 5
/var/swap file 102396 0 -2
[email protected]:~ $

So what does it mean? Is it good? Can I do better? How do modify the settings?

Ralph

Ralphxyz
Posts: 45
Joined: Wed Jan 01, 2014 7:20 pm

Re: How to ZRAM?

Sun Apr 07, 2019 8:16 pm

Thanks Void Frost, BUT???

So what now what do I do? How big should I go how small should I go?

Is modifying the SWAP better than ZRAM?

Ralph

User avatar
Void Frost
Posts: 55
Joined: Sun Jul 01, 2018 2:13 am

Re: How to ZRAM?

Sun Apr 07, 2019 10:31 pm

So SWAP is ZRAM.
I don't really know how much you should or shouldn't use
Raspberry Pi User. Subscribe to my YouTube channel, if you want :D https://www.youtube.com/c/VoidFrost

mrreality13
Posts: 56
Joined: Tue Feb 26, 2019 6:45 am
Location: texas usa

Re: How to ZRAM?

Sun Apr 07, 2019 11:02 pm

1. First, run the following command to open up the dphys-swapfile in the nano editor.

sudo nano /etc/dphys-swapfile
2. In here, find and edit the CONF-SWAPSIZE line, so it looks like the line below. (Changing 100 to 2048)

CONF_SWAPSIZE=2048
3. Once done, save and exit by pressing ctrl+x, then y and then enter.

4. Now restart the swap service by entering the following line

sudo /etc/init.d/dphys-swapfile restart
this is what worked for me,i tried several other ways and all but this after reboot would default back to the 100mb-i use a 128 gig ssd btw
remember ,never approach a computer thinking this will only take a minute
~~pi zero w and a 3b+

Ralphxyz
Posts: 45
Joined: Wed Jan 01, 2014 7:20 pm

Re: How to ZRAM?

Sun Apr 07, 2019 11:25 pm

I do not have a Solid State Drive, yet, I should be getting a A+ SD tomorrow.

What are the recommended SSD to use with USB2?

Ralph

echmain
Posts: 285
Joined: Fri Mar 04, 2016 8:26 pm

Re: How to ZRAM?

Mon Apr 08, 2019 12:19 am

Ralphxyz wrote:
Sun Apr 07, 2019 11:25 pm
I do not have a Solid State Drive, yet, I should be getting a A+ SD tomorrow.

What are the recommended SSD to use with USB2?

Ralph

I'm not aware of a list of known compatible drives, but the one I bought was an "Inland" 120gb SSD for $18. (Inland is Microcenter's house brand).

That plus a $5 USB enclosure. Works perfectly.

I'm not using zram (hadn't heard of it) but I did increase swap space to 1gb.

mrreality13
Posts: 56
Joined: Tue Feb 26, 2019 6:45 am
Location: texas usa

Re: How to ZRAM?

Mon Apr 08, 2019 3:16 am

echmain wrote:
Mon Apr 08, 2019 12:19 am
Ralphxyz wrote:
Sun Apr 07, 2019 11:25 pm
I do not have a Solid State Drive, yet, I should be getting a A+ SD tomorrow.

What are the recommended SSD to use with USB2?

Ralph

I'm not aware of a list of known compatible drives, but the one I bought was an "Inland" 120gb SSD for $18. (Inland is Microcenter's house brand).

That plus a $5 USB enclosure. Works perfectly.

I'm not using zram (hadn't heard of it) but I did increase swap space to 1gb.
i have several microcenter flash drives that are over 10 yrs old still work fine,,,for my pi i use this https://www.amazon.com/gp/product/B077Q ... UTF8&psc=1
its the size of a zero in a case
remember usb 3 is backwards compatible i chose this since my lappy has usb3
remember ,never approach a computer thinking this will only take a minute
~~pi zero w and a 3b+

Return to “Beginners”