zram enquiry.

Hello

Prior to converting both my PCs to oS TW, back when they used to use Mint KDE4 & then Maui Plasma5, i successfully used zram for memory/swap benefits. Since i now use TW, i’ve been experimenting with zram in some of my openSUSE TW VMs, to gauge if they might later be worthwhile deploying in the “real” TWs.

I found that there seems to be some alternatives, which i’ve been trying to understand their respective applicability & pros/cons.

http://i.imgur.com/IsysSLY.png

I understand Malcolm’s systemd-zram-service-0.2.1-1.7.noarch.rpm ok, for which in one VM i achieved:

BEFORE enabling & starting *zramswap.service
*linux-bgps:~> free -h
              total        used        free      shared  buff/cache   available
Mem:           2.0G        562M        586M         10M        850M        1.2G
Swap:          **2.0G**          0B        2.0G


linux-bgps:~> free -h |grep Swap
Swap:          2.0G          0B        2.0G
.................................................................................




AFTER enabling & starting zramswap.service
linux-bgps:~> free -h
              total        used        free      shared  buff/cache   available
Mem:           2.0G        570M        578M         10M        850M        1.2G
Swap:          **4.0G**          0B        4.0G


linux-bgps:~> free -h |grep Swap
Swap:          4.0G          0B        4.0G

However i’m puzzled by zramcfg, which either i’ve incorrectly deployed [in a separate VM], or otherwise might be broken:

linux-sr0s:~> free -h              total        used        free      shared  buff/cache   available                                                                                  
Mem:           2.9G        1.1G         79M         18M        1.7G        1.6G                                                                                  
Swap:          2.0G         91M        1.9G                                                                                                                      

linux-sr0s:~> **sudo systemctl enable zramcfg.service**                                                                                                      
[sudo] password for root:                                                                                                                                        
Created symlink /etc/systemd/system/multi-user.target.wants/zramcfg.service → /usr/lib/systemd/system/zramcfg.service.                                           
linux-sr0s:~> **sudo systemctl start zramcfg.service**                                                                                                       

linux-sr0s:~> **sudo systemctl status zramcfg.service**                                                                                                      
● zramcfg.service - ZRAM configuration                                                                                                                           
   Loaded: loaded (/usr/lib/systemd/system/zramcfg.service; enabled; vendor preset: disabled)                                                                    
   Active: active (exited) since Sat 2017-07-29 21:11:34 AEST; 16s ago                                                                                           
  Process: 30963 ExecStart=/usr/sbin/zramcfg load (code=exited, status=0/SUCCESS)                                                                                
 Main PID: 30963 (code=exited, status=0/SUCCESS)                                                                                                                 
                                                                                                                                                                 
Jul 29 21:11:34 linux-sr0s systemd[1]: Starting ZRAM configuration...                                                                                             
Jul 29 21:11:34 linux-sr0s zramcfg[30963]: **Could not load configuration file /etc/zram.cfg**
Jul 29 21:11:34 linux-sr0s systemd[1]: Started ZRAM configuration.

linux-sr0s:~> free -h
              total        used        free      shared  buff/cache   available
Mem:           2.9G        1.1G         81M         18M        1.7G        1.6G
Swap:          2.0G         91M        1.9G

Sure enough, when i inspect /etc/ , there is no file *zram.cfg

*My questions are, please:

  1. Did i do something wrong with zramcfg
    , or is it broken? 1. What’s the best way to decide between those 4 alternatives in my original picture, ie, which one to use?

Hi
If you look at the man page and python script, it looks like you need the run the command manually first (zramcfg.py) and set the configuration. It also points to zramctl, perhaps you need to look at the man page for this as well…?

https://github.com/hreinecke/zramcfg

Ah, man-pages, sigh. I hope that some day soon when i wake up, i will have finally got it through my skull that man-pages exist, are a thing, & that i need to look at them first. For inexplicable reasons, i still constantly forget all about them. Sorry.

Anyway, they didn’t assist me to progress here, but not to worry, i’ll just keep using your one systemd-zram-service], & begin frying other fish now. Thank you once more.

The ArchWiki pages are usually of good value too…

https://wiki.archlinux.org/index.php/Improving_performance#Zram_or_zswap

Oh cool, thank you.

I finished a fifth script today, which should superceed the one from malcolm, is simple and pretty stable (at least the version I am working on now, it might happen, that you’ll get a broken release, because I’m updating the package)
My goal was to make a simple, robust and foolproof package.

https://build.opensuse.org/package/show/home:Mihail-Klr/zramservice

no need for zramcfg, in fact you should avoid using multiple zram managers :slight_smile:
Feel free to give feedback