Large swap size on RPI4 4GB

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • TomekWaw
    LoxBus Spammer
    • 25.07.2019
    • 436

    Large swap size on RPI4 4GB

    So I have this new RPi 4B with 4GB of RAM which is more than enough.
    Not more than 1GB is used all the time:

    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: Clipboard01.png
Ansichten: 259
Größe: 7,5 KB
ID: 266109

    But LoxBerry set swap to giant >5GB which seems unnecessary.
    I'm considering disabling swap at all in care of the microsd card.
    Whats the best way to do it?
    Shall I set CONF_SWAPSIZE=0 in /opt/loxberry/system/dphys-swapfile/dphys-swapfile ?
    Will this be overridden with updates or not?
    Noch ein oder zwei Jahre mit Loxone und ich werde Deutsch sprechen
  • Christian Fenzl
    Lebende Foren Legende
    • 31.08.2015
    • 11226

    #2
    You can change this file, it will not be overwritten by LoxBerry.

    "Swappiness" is set very low on LoxBerry, but we were required to enable swapping, as some software requires more ram (e.g. InfluxDB) than 1 GB.
    Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine

    Kommentar

    • svethi
      Lebende Foren Legende
      • 25.08.2015
      • 6308

      #3
      I think swap is also needed for the RAM disc.
      Miniserver; KNX; Vitogate; EnOcean (EnOceanPi); Loxone Air; Caldav-Kalenderanbindung; RaspberryPi und für keine Frickellösung zu schade :-)

      Kommentar

      • Prof.Mobilux
        Supermoderator
        • 25.08.2015
        • 4691

        #4
        Swapfile size is calculated twice as RAM is installed, but a maximum of 50% free discspace on /var. I would not put it to zero. This was the configuration in the past (around 1.0), and it ended up in lot of problems. I would suggest to leave it at least at 500MB or so.

        If you change /opt/loxberry/system/dphys-swapfile/dphys-swapfile manually, LoxBerry should recognize your changes and should leave the file untouched.
        🇺🇦 Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine


        LoxBerry - Beyond the Limits

        Kommentar

        • TomekWaw
          LoxBus Spammer
          • 25.07.2019
          • 436

          #5
          Ok, thanks, I will set it to 1024 MB then, I believe it's more than enough in my setup.

          One more question, not regarding swap in particular, but microsd card wear in general.
          I try to keep my LoxBerry disk writes as low as possible (obviously).

          Lately, I've discovered some write increase (from ~0.1 IPOS to ~1.8 IPOS).
          I have narrowed it down to deCONZ writing requently to /opt/deconz/zll.db
          I described my observations here:
          https://github.com/dresden-elektroni...in/issues/3271
          but nobody answered and I doubt anybody will.

          Perhaps deCONZ writes (or started to write) any state change to zll.db and I have a lot of Zigbee sensors and devices (~50).
          So unless I'll find a way to tune deCONZ not to write it so frequently, there's nothing I can do about it.

          I have figured out I might change ext4 commit setting instead.
          AFAIK its 5 seconds by default and I believe its default in Loxberry.
          I have all my RPis on UPS, so I'm not afraid of power outage.
          So, Is it ok if I change entry in etc fstab from:

          Code:
          PARTUUID=4bd27daf-02 / ext4 defaults,noatime 0 1
          to:

          Code:
          PARTUUID=4bd27daf-02 / ext4 defaults,noatime[COLOR=#e74c3c][B],commit=600[/B][/COLOR] 0 1
          Is this acceptable? Does it makes sense, anybody uses that?
          Zuletzt geändert von TomekWaw; 19.09.2020, 22:42.
          Noch ein oder zwei Jahre mit Loxone und ich werde Deutsch sprechen

          Kommentar


          • Prof.Mobilux
            Prof.Mobilux kommentierte
            Kommentar bearbeiten
            Sorry, cannot say anything about that.
        • Christian Fenzl
          Lebende Foren Legende
          • 31.08.2015
          • 11226

          #6
          If deCONZ survives if it’s db is missing after reboot, you may place the db to the ramdisk (e.g. /tmp).
          Hilfe für die Menschen der Ukraine: https://www.loxforum.com/forum/proje...Cr-die-ukraine

          Kommentar


          • TomekWaw
            TomekWaw kommentierte
            Kommentar bearbeiten
            I believe this is the "main" database file that contains all devices connected, so it would start fresh every time
        Lädt...