ZRAM or ZSWAP on a computer with 3gb RAM. I currently have ZRAM set up for swap of 3gb and a swap partition of 5gb as backup for ZRAM. Should I get rid of ZRAM and convert to ZSWAP. What will performance be like as just running a browser the machine struggles and when I open an email program ZRAM becomes full and the system starts to swap to disk with a performance hit. Any thoughts?

  • Axios All these settings are applicable to Solus, less likely to work without tweaking elsewhere.

    ZSWAP FOR SYSTEMS WITH LESS THAN 16GB RAM
    sudo eopkg it zram-generator-defaults
    To enable zswap - disable zram. Create an empty configuration to null out zram-generator.
    sudo touch /etc/systemd/zram-generator.conf
    Then to enable Zswap: Make sure the folder exists
    sudo mkdir -p /etc/kernel/cmdline.d
    Create the file
    echo "zswap.enabled=1" | sudo tee /etc/kernel/cmdline.d/20_zswap.conf
    Update the boot configuration so the new argument is applied
    sudo clr-boot-manager update
    Reboot - it should be working. No need to reboot between disabling Zram and enabling Zswap.

    After reboot make sure that it's working by running
    dmesg | grep zswap
    If you see zswap: loaded using pool zstd/z3fold then it's working. You can see if Zram is running by doing
    dmesg | grep zram
    which should display nothing if zram is disabled.

    SWAPPINESS
    Test level of swappiness
    cat /proc/sys/vm/swappiness
    Solus sets the swappiness to 100 in /usr/lib/sysctl.d/70-zram.conf (if you don't have this file then you probably don't have Zram or Zswap enabled).
    On other OSs that are running a recent kernel setting swappiness to 100 helps due to improvements in the way that Linux deals with swap. The control to change swappiness will most likely be in a different location.

ZRAM vs ZSWAP results tend to vary depending on the spec of the computer. ZSWAP has more efficient use of RAM but there is also a CPU overhead due to the compression. Consequently it tends to be more problematic when used with a weaker CPU.
To be honest, despite being keen on the technical aspect of ZRAM, I really haven't noticed much difference between the two.
You would probably get better results by looking at the programs that are struggling. If you are using the stock Firefox browser the following tweaks make a noticeable difference.

FIREFOX TWEAKS
about:config
extensions.pocket.enabled
set to false
browser.sessionstore.interval
Change from 15000 to 15000000
MOVE FIREFOX NETWORK CACHE INTO RAM - Needs 2 GB OF RAM OR MORE
browser.cache.disk.enable
set to false
browser.cache.memory.enable
set to true
browser.cache.memory.capacity
Change from -1 to 524288 (KB, = 512 MB RAM)
browser.sessionhistory.max_entries
Change from 50 to 25
browser.sessionhistory.max_total_viewers
Change from -1 to 0
browser.sessionstore.max_tabs_undo
Change from 25 to 5

Stop Firefox from installing and running studies.
about:preferences#privacy
Uncheck all the boxes under Firefox Data Collection and Use

https://addons.mozilla.org/en-US/firefox/addon/i-dont-care-about-cookies/
https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/

The alternative would be to use a browser that is lighter on resources.

Other thoughts.
Using an SSD instead of a spinning disc will free up resources and make everything feel quicker.
Turn off as many OS animations and system sounds as possible.
Make sure your hard drive has good health.
Check that the installed RAM is not faulty.
Not all RAM is equal, slow or mismatched RAM needs to be avoided. Always try to install the fastest RAM that is recommended for your PC.

    BuzzPCSOS I usually add stuff to my linux tweaks file but guess I didnt
    I think it was you that gave me a zram setting or something awhile back
    Remember testing and stuff on my 2gig ram machines it seemd to help alot
    But for more ram it did not seem to make much difference
    But for life of me can not remb what it was ?

      Axios All these settings are applicable to Solus, less likely to work without tweaking elsewhere.

      ZSWAP FOR SYSTEMS WITH LESS THAN 16GB RAM
      sudo eopkg it zram-generator-defaults
      To enable zswap - disable zram. Create an empty configuration to null out zram-generator.
      sudo touch /etc/systemd/zram-generator.conf
      Then to enable Zswap: Make sure the folder exists
      sudo mkdir -p /etc/kernel/cmdline.d
      Create the file
      echo "zswap.enabled=1" | sudo tee /etc/kernel/cmdline.d/20_zswap.conf
      Update the boot configuration so the new argument is applied
      sudo clr-boot-manager update
      Reboot - it should be working. No need to reboot between disabling Zram and enabling Zswap.

      After reboot make sure that it's working by running
      dmesg | grep zswap
      If you see zswap: loaded using pool zstd/z3fold then it's working. You can see if Zram is running by doing
      dmesg | grep zram
      which should display nothing if zram is disabled.

      SWAPPINESS
      Test level of swappiness
      cat /proc/sys/vm/swappiness
      Solus sets the swappiness to 100 in /usr/lib/sysctl.d/70-zram.conf (if you don't have this file then you probably don't have Zram or Zswap enabled).
      On other OSs that are running a recent kernel setting swappiness to 100 helps due to improvements in the way that Linux deals with swap. The control to change swappiness will most likely be in a different location.

        BuzzPCSOS It was swappiness it does make a difference on 2gig if one takes time to test
        different settings you can home in on sweet spot usually.

          Axios The way Linux deals with swap has moved on a lot recently but most of the listed performance tweaks listed on the net (including the ones 'updated' for 2024) still suggest much lower values. One of the many built-in tweaks that makes Solus so special.
          Edit: So what special value did you tune to eventually? I was so pleased with how well 100 worked that I left it there and let the OS determine the optimisation but that was on my Linx with 4GB RAM. Maybe there is a sweeter spot for 2GB.
          From the original conversation with @ReillyBrogan values of 80/90 would be more appropriate if physical swap is in use. I will have to take another look at my own system as can't remember without checking if I set a swap partition.