That would depend on your workload. Zram is used like swap (just with a different priority by default). I use zram mostly during data processing (pandas/python) and I see compression ratios of around 1/4. That means that a full 32gb zram device takes up 8gb of ram. At that point your 32gb of ram would hold 56gb of uncompressed data.
However if you have less/more compressible data that changes. I expect data in RAM will always be quite compressible, the zram devs claim lower than 1/2 is very unlikely.
If you wouldnât expect to need more than that there wonât be an advantage to setting it higher. There is no large drawback to large zram either, except that the kernel might tend to keep stuff around for longer if it sees a large swap space (though that behaviour is tunable too via swappiness and such).
If you really have a strong need for zram you can monitor the use via zramctl, and conclude from there. If not, 100% if probably fine.
Best zram setting is getting more ram in the first place. I like the concept, but from my experience, zram is only used when you run out of memory. Very bad time to suddenly compress stuff. Oh and check on the different compression algorithms. LZ4 is insanely fast while ZSTD really gets you the higher compression ratios. What to take? Entirely depends on how fast your cores are. But having ZSTD as default is a good decision by System76 (though Iâd prefer lz4 on a laptop just because of CPU power consumption)
Canât say anything about that âportionâ thing, might be some pop os custom script. Never seen this parameter, although cache pressure and swappiness I used before to tune things.
ok thanks for that , 3 questions above is my current settings
1 . that swap is in ram ,not to disk right
2 . when i edit image pixs in krita that are 10000 x 8000 @200dpi tiffs with a 500mg avg file size with 2 - 3
working layers my memory usage goes up to about 70% sometimes more an my available drops to
sometimes less hen 6gb with i have lower usage an more free if i set swapness higher or set zram to
150% or both ?
3 . would this also with downloading an loading games
these are my custom vm settings that for my do me well
That is what I would have expected. If zram gets used sooner, a larger portion of memory is compressed thus total use lower.
Tuning is rather complicated in general and dependent on your workload. The most important variables are the compression algorithm and page-cluster. Page-cluster gives a tradeoff of bandwidth vs. latency (0 being lowest latency) and the algorithm gives a tradeoff speed vs. compression ratio (zstd is the best for higher compression, lzo-rle is fastest): See here, Also interesting is this thread of the pop os people.
In general most of this stuff really depends on your workload and youâll need to benchmark it if you want it optimal. For gaming it probably rarely matters, but I would opt for lzo-rle with page-cluster=0 and same size as ram size and keep a medium swappiness (50-100 or so)
Yes that is swappiness (but not ONLY swappiness, other variables are relevant too). IIRC swappiness 0 will only start swapping if RAM is completely full â for higher values it starts swapping older or cache pages sooner.
htop has meters to show zram and also shows compression. Just run out of memory and you can see zram at work. I now have ZFS ARC shown there, but when using zram I always checked htop for a quick overview. You may have to add the meters via F2 setup menu though