Robot1me wrote: ⤴Mon Jun 22, 2020 7:53 am
Hey there,
funnily enough I spent time with that recently and I can tell you the easiest way. You can let zram-config do the work for you:
After a system reboot, you can check if zram works by using
and
Additionally, you can increase the vm.swappiness value to 100 in order to make the kernel swap to zram sooner. It's especially worth it if you want to maximize your RAM and if CPU performance is no bottleneck. You can check this answer to find out how to do that:
https://askubuntu.com/questions/463281/ ... ter-reboot
Should you change your mind, you can uninstall zram-config to remove the zram devices again:
OK this is good stuff - it makes setting it up easy, but . . . . . there is still too much I don't understand and so far can't find answers to. First of which why do I want to swap to zram sooner?
DAMIEN1307 wrote: ⤴Mon Jun 22, 2020 9:27 am
Additionally, you can increase the vm.swappiness value to 100 in order to make the kernel swap to zram sooner
That is about the best way to do zram that i have seen thus far...DAMIEN
What is really crazy is I have configured zRAM on two PCs and a laptop with three different results although all three have similar CPUs and all have 16Gb of RAM. I have configured zRAM on PC(majpooper) 8 core AMD Bulldozer w/ 16Gb RAM where I deleted the swap file and commented out swap in fstab. The laptop (dufus) i7 CPU w/16Gb RAM where I set swapiness =1 and the swap file remains. And PC (fluffy) i7 CPU w/16Gb RAM where I set swapiness =1 and the swap file remains. Why are all three zRAM configurations so different ?
It seems I would want to be able to configure how big I want zRAM to be based on the CPU and how much RAM is available. In my case with three similar systems it goes from 1Gb with no swapfile to 8Gb with a 1Gb swapfile all the way to 16Gb with a 2Gb swapfile if I am reading things correctly.
And really in the end I though what I wanted to accomplish is replace say a 2Gb swapfile on the hard drive with 2Gb of zRAM hence delete and comment out the swapfile. And I really didn't think I wanted the system to go to swap any sooner with zRAM than I did with a swapfile I just thought zRAM would be faster when the system did go to swap.
Again I really don't need this for my rigs although I will leave things be for now to see how they react if at all. Why I want to understand how to configure zRAM is for instances that I run into when asked to install linux on an old or resource challenged PC or laptop so I want some control in terms of how zRAM is configured
Code: Select all
majpooper@1150z:~$ zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 998.9M 4K 74B 12K 8 [SWAP]
majpooper@1150z:~$ swapon -s
Filename Type Size Used Priority
/dev/zram0 partition 1022824 0 5
Code: Select all
dufus@T430:/$ zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram3 1.9G 4K 74B 12K 4 [SWAP]
/dev/zram2 1.9G 4K 74B 12K 4 [SWAP]
/dev/zram1 1.9G 4K 74B 12K 4 [SWAP]
/dev/zram0 1.9G 4K 74B 12K 4 [SWAP]
dufus@T430:/$ swapon -s
Filename Type Size Used Priority
/dev/dm-2 partition 1003516 0 -2
/dev/zram0 partition 2014628 0 5
/dev/zram1 partition 2014628 0 5
/dev/zram2 partition 2014628 0 5
/dev/zram3 partition 2014628 0 5
Code: Select all
fluffy@hp700:~$ zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram7 994.9M 4K 74B 12K 8 [SWAP]
/dev/zram6 994.9M 4K 74B 12K 8 [SWAP]
/dev/zram5 994.9M 4K 74B 12K 8 [SWAP]
/dev/zram4 994.9M 4K 74B 12K 8 [SWAP]
/dev/zram3 994.9M 4K 74B 12K 8 [SWAP]
/dev/zram2 994.9M 4K 74B 12K 8 [SWAP]
/dev/zram1 994.9M 4K 74B 12K 8 [SWAP]
/dev/zram0 994.9M 4K 74B 12K 8 [SWAP]
fluffy@hp700:~$ swapon -s
Filename Type Size Used Priority
/swapfile file 2097148 0 -2
/dev/zram0 partition 1018788 0 5
/dev/zram1 partition 1018788 0 5
/dev/zram2 partition 1018788 0 5
/dev/zram3 partition 1018788 0 5
/dev/zram4 partition 1018788 0 5
/dev/zram5 partition 1018788 0 5
/dev/zram6 partition 1018788 0 5
/dev/zram7 partition 1018788 0 5