Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Unbound crashes daily, 'out of swap space'

    Scheduled Pinned Locked Moved DHCP and DNS
    14 Posts 3 Posters 2.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SteveITS Galactic Empire @KOM
      last edited by

      @kom What is your available memory? Do you have an older version? 2.5/21.05 had a memory leak in pcscd. There is a patch in the System Patches package to disable it properly. If you aren't using IPSec you can just stop the service, or can restart the router to reset the memory usage. (if you are using IPSec just stopping this service causes other problems)

      Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
      When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
      Upvote ๐Ÿ‘ helpful posts!

      KOMK 1 Reply Last reply Reply Quote 0
      • KOMK
        KOM @SteveITS
        last edited by KOM

        @steveits I should have mentioned it's an SG-1100 running 22.01 which has 1G RAM and an 8G disk. Memory usage is typically at 50%, disk is zfs at 11%. I do not have the pcscd service running.

        GertjanG 1 Reply Last reply Reply Quote 0
        • GertjanG
          Gertjan @KOM
          last edited by

          @kom

          Memory usage

          The GUI reports right now :

          ecdc13e6-dfd3-4546-b825-40aedeb1ce3e-image.png

          Using acme cron filer Notes Avahi openvpn-client-export System_Patches NUT Shellcmd, these have a very small disk foot print, and do not run permanently. If they run, they don't use a lot of memory.

          The big one could be pfBlockerNG-devel, but I use it more as a case study, with less then 20 thousand lines of DNSBL and a small hundred IP's.
          When I take down pfBlockerNG-devel (disable IP and DNSBL), the memory footprint drops to env 500 Mbytes usage.
          I'm also using Freeradius. It looks stable to me in its memory usage.

          Look again of at the memory graph : 1 Gbytes would work for me (I guess).
          The very moment the system starts using one byte of swap space, consider taking down processes.
          Service Watchdog is useless, as it will kill a doing system. unbound was probably being killed for Out Of Memory reasons by the OS, by the flip-of-a-coin election. It didn't crash, and if it did, it was it ran out of memory. The Watchdog doesn't make more memory. It will just eat more rare system resources.

          Use the ssh command line tool 'top', or better, install 'pkg install htop' and use it, sort on memory usage and watch what happens over time.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          KOMK 1 Reply Last reply Reply Quote 0
          • KOMK
            KOM @Gertjan
            last edited by

            @gertjan Service Watchdog is a necessary evil since Unbound started crashing. I have a house full of people, some of whom work from home and need a stable Internet connection. If Unbound dies while I'm in the office, then everyone is out of luck which is not acceptable. I also suspect pfB but can't reconcile the error with the RAM and disk usage stats. I already have an ssh session open running top sorted by memory use.

            GertjanG S 2 Replies Last reply Reply Quote 1
            • GertjanG
              Gertjan @KOM
              last edited by

              @kom said in Unbound crashes daily, 'out of swap space':

              Service Watchdog is a necessary evil since Unbound started crashing.

              I understand. Some solution is better as no solution.

              I don't have to an example log line, but there are typical log messages that show that a process is thrown of the running list, terminated, for OOM (Out Of Memory) reasons. Swapping is a very resource extensive task, and when that start, things go down hill very fast.

              Btw : the subject : "out of swap space" : any OS would OOM process(es), or it's instant kernel death time.
              No choice : lower your needs, or convert an old desktop PC or .... use a Q-Box clone or visit 'the store'.

              I don't have hands-on experience with a SG1100 - I saw a red SG1000 ones, I loved it, but wouldn't dare putting a "2022" household behind, as I would be condemned by sleeping in the dog house in no time ....

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              1 Reply Last reply Reply Quote 0
              • S
                SteveITS Galactic Empire @KOM
                last edited by

                @kom I don't think the 1100 or other ARM (maybe all eMMC?) devices have swap, so it's just running out of memory and saying it can't use the (zero) swap space. Our 3100 doesn't have swap. Swap on an eMMC I think would glacially slow.

                re: Service Watchdog, it's a double edged sword since I've seen comments it will interfere with service restarts as you noted. Are you sure unbound isn't being started twice in some instances? I recall that being the issue with it and Snort/Suricata.

                Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                Upvote ๐Ÿ‘ helpful posts!

                KOMK 1 Reply Last reply Reply Quote 0
                • KOMK
                  KOM @SteveITS
                  last edited by

                  I'm still suspecting pfB but I don't see anything definitive in the logs. pfB seems to have 29 different log files so who knows.

                  KOMK 1 Reply Last reply Reply Quote 1
                  • KOMK
                    KOM @KOM
                    last edited by

                    @kom Unbound RAM usage went from 147M to 152M in a day. I have pfB set to update only once a day at 12:30am. I did not receive any watchdog alerts last night or all day yesterday so far.

                    GertjanG 1 Reply Last reply Reply Quote 0
                    • GertjanG
                      Gertjan @KOM
                      last edited by

                      @kom
                      Here is mine :

                      34280805-98d1-456f-8302-e780a9c5da37-image.png

                      Does this you mean that you've added for about 50 Mbytes worth of DNSBL and IP's ?

                      I'm not using the 'arm' version, but the classic 'amd64'.

                      No "help me" PM's please. Use the forum, the community will thank you.
                      Edit : and where are the logs ??

                      KOMK 1 Reply Last reply Reply Quote 0
                      • KOMK
                        KOM @Gertjan
                        last edited by

                        @gertjan Perhaps. I don't know. I have no idea how much space the various lists consume. I haven't added any custom lists, I just use the defaults.

                        GertjanG 1 Reply Last reply Reply Quote 0
                        • GertjanG
                          Gertjan @KOM
                          last edited by

                          @kom
                          This morning it shows 108 Mbytes, that's 2 Mbytes more.
                          Could be the dns cache, I'm not sure.
                          I'll follow the mem usage for some time.

                          No "help me" PM's please. Use the forum, the community will thank you.
                          Edit : and where are the logs ??

                          GertjanG 1 Reply Last reply Reply Quote 0
                          • GertjanG
                            Gertjan @Gertjan
                            last edited by

                            Stupid me.
                            Some one is already tracing unbound memory usage every 5 minutes.
                            Here.

                            There is a memory usage chart.
                            As you can see, everything came to a 'crashing' halt (the stats) last night (GMT +2) : pfBlocker decided to do a rstart on unbound as some DNSBL was updated.
                            That's actually a positive effect of restarting a process : if there was a memory leak, even small, a restart would clean them up.
                            Your setup should does the same I guess, but your memory ceiling is much lower.

                            No "help me" PM's please. Use the forum, the community will thank you.
                            Edit : and where are the logs ??

                            KOMK 1 Reply Last reply Reply Quote 0
                            • KOMK
                              KOM @Gertjan
                              last edited by

                              @gertjan I also have a running session tracking memory. It grew at first by 3-5M and then has been stable for 2 days now. We'll see over the next week or two.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.