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

swap usage shows 100%

General pfSense Questions
6
23
783
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.
  • G
    Gertjan @michmoor
    last edited by Mar 7, 2025, 10:19 AM

    @michmoor said in swap usage shows 100%:

    The IPS packages take up ...

    nothing when you install them.
    Some memory when you activated them, if there are any 'default' (suggested) rules or conditions or lists.
    Then the admin start to add a 'max' of other conditions, rules etc ....
    At this precise moment, the admin has a new job : monitoring the system resources very frequently.
    As IPS, also pfBlockerng, will take what it needs to do the job.
    Suddenly, "4 Gbytes of RAM" becomes a very limited resource. 16 or 32 Gbytes of disk space is even worse.

    In your case, the packages took what RAM was avaible. real RAM ran out, the system starts to use the spare 'virtual' RAM : starts to use the extremely slow swap space, and when that's filled up also, it, the OS, will start to kill randomly (the biggest resource users first) processes.
    Things will go downhill fast from this point.
    Using swap on a desktop PC, phone, or any other end user deice is probably more ok, but not for routers and that kind of equipment.

    IPS tools are like toddlers : you keep an eye om them, even when they sleep.

    So, choices to make :
    Start doing some (more) serious resource management.
    and/or
    Use less 'IPS' (and other) functionalities.

    Btw : normally, it's not the RAM that goes low, but its the disk space filled up to 100 % as massive log files are created, and that will trigger a kernel panic for sure, with a chance that it can't reboot anymore.

    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 1
    • P
      posix @stephenw10
      last edited by Mar 7, 2025, 8:50 PM

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • P
        posix @bmeeks
        last edited by posix Mar 7, 2025, 8:57 PM Mar 7, 2025, 8:52 PM

        Hello @bmeeks
        Edited message to show MD5 hash:

        Rule Set Name/Publisher	MD5 Signature Hash	MD5 Signature Date
        Snort Subscriber Ruleset	dbc140f3f6c01f0cff5e53d63e462df7	Thursday, 06-Mar-25 12:32:47 EST
        Snort GPLv2 Community Rules	Not Enabled	Not Enabled
        Emerging Threats Open Rules	Not Enabled	Not Enabled
        Snort OpenAppID Detectors	c726cf937d84c651a20f2ac7c528384e	Thursday, 28-Nov-24 19:42:42 EST
        Snort AppID Open Text Rules	2c26cb4f6a3bc03ab9c8e02befcf6fe1	Thursday, 28-Nov-24 19:42:42 EST
        Feodo Tracker Botnet C2 IP Rules	Not Enabled	Not Enabled
        
        1 Reply Last reply Reply Quote 0
        • P
          posix @stephenw10
          last edited by Mar 7, 2025, 8:59 PM

          Hello @stephenw10

          I updated the graph

          login-to-view

          1 Reply Last reply Reply Quote 0
          • P
            posix
            last edited by Mar 8, 2025, 10:33 PM

            Don't know if this helps since it was mentioned about disk space:

            /root: df -h
            Filesystem                     Size    Used   Avail Capacity  Mounted on
            /dev/ufsid/61bf5ededf06b426    227G     70G    138G    34%    /
            devfs                          1.0K      0B    1.0K     0%    /dev
            tmpfs                          4.0M    204K    3.8M     5%    /var/run
            /lib                           227G     70G    138G    34%    /var/unbound/lib
            devfs                          1.0K      0B    1.0K     0%    /var/unbound/dev
            /var/log/pfblockerng           227G     70G    138G    34%    /var/unbound/var/log/pfblockerng
            /usr/local/share/GeoIP         227G     70G    138G    34%    /var/unbound/usr/local/share/GeoIP
            /usr/local/bin                 227G     70G    138G    34%    /var/unbound/usr/local/bin
            /usr/local/lib                 227G     70G    138G    34%    /var/unbound/usr/local/lib
            devfs                          1.0K      0B    1.0K     0%    /var/dhcpd/dev
            
            G 1 Reply Last reply Mar 9, 2025, 10:58 AM Reply Quote 0
            • G
              Gertjan @posix
              last edited by Mar 9, 2025, 10:58 AM

              Just checking :

              @posix said in swap usage shows 100%:

              /var/log/pfblockerng 227G 70G 138G 34% /var/unbound/var/log/pfblockerng

              I use the default pfBlockerng log file 'size' setup :

              login-to-view

              and right now that about 110 Mbytes for me:

              login-to-view

              You : really 70 Gbytes ?

              pfBlockerng use these files to generate these pages on demand :

              login-to-view

              If your files are that big, it would take ages to do that .... nginx/PHP will probably time out.

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

              P 2 Replies Last reply Mar 10, 2025, 8:18 PM Reply Quote 0
              • P
                posix @Gertjan
                last edited by Mar 10, 2025, 8:18 PM

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • P
                  posix @Gertjan
                  last edited by Mar 10, 2025, 8:32 PM

                  @Gertjan

                  Edit I see the pfblockerlogs increasing:

                  Thanks for the response, the log size I have configured are the same

                  login-to-view

                  /var/log/pfblockerng: ls -l
                  total 20376
                  -rw-------  1 unbound unbound 2012634 Mar 10 16:16 dns_reply.log
                  -rw-------  1 unbound unbound 2474917 Mar 10 16:16 dnsbl.log
                  -rw-------  1 root    wheel   5258413 Mar 10 16:00 dnsbl_parsed_error.log
                  -rw-------  1 root    wheel    426448 Mar 10 16:00 error.log
                  -rw-------  1 root    wheel    274484 Mar 10 16:00 extras.log
                  -rw-------  1 root    wheel   3481641 Mar 10 16:11 ip_block.log
                  -rw-------  1 root    wheel   3649640 Mar 10 16:00 ip_permit.log
                  -rw-r--r--  1 root    unbound     120 Mar 10 12:00 maxmind_ver
                  -rw-------  1 root    wheel    624287 Mar 10 16:00 pfblockerng.log
                  -rw-r--r--  1 unbound unbound     229 Feb 21  2023 py_error.log
                  -rw-------  1 unbound unbound 2208509 Mar 10 16:16 unified.log
                  

                  second capture:

                  -rw-------  1 unbound unbound 2054793 Mar 10 16:23 dns_reply.log
                  -rw-------  1 unbound unbound 2484058 Mar 10 16:22 dnsbl.log
                  -rw-------  1 root    wheel   5258413 Mar 10 16:00 dnsbl_parsed_error.log
                  -rw-------  1 root    wheel    426448 Mar 10 16:00 error.log
                  -rw-------  1 root    wheel    274484 Mar 10 16:00 extras.log
                  -rw-------  1 root    wheel   3483020 Mar 10 16:18 ip_block.log
                  -rw-------  1 root    wheel   3649640 Mar 10 16:00 ip_permit.log
                  -rw-r--r--  1 root    unbound     120 Mar 10 12:00 maxmind_ver
                  -rw-------  1 root    wheel    624287 Mar 10 16:00 pfblockerng.log
                  -rw-r--r--  1 unbound unbound     229 Feb 21  2023 py_error.log
                  -rw-------  1 unbound unbound 2260172 Mar 10 16:23 unified.log
                  

                  right now up at 75G

                  /var/log/pfblockerng: df -h
                  Filesystem                     Size    Used   Avail Capacity  Mounted on
                  /dev/ufsid/61bf5ededf06b426    227G     75G    133G    36%    /
                  devfs                          1.0K      0B    1.0K     0%    /dev
                  tmpfs                          4.0M    204K    3.8M     5%    /var/run
                  /lib                           227G     75G    133G    36%    /var/unbound/lib
                  devfs                          1.0K      0B    1.0K     0%    /var/unbound/dev
                  /var/log/pfblockerng           227G     75G    133G    36%    /var/unbound/var/log/pfblockerng
                  /usr/local/share/GeoIP         227G     75G    133G    36%    /var/unbound/usr/local/share/GeoIP
                  /usr/local/bin                 227G     75G    133G    36%    /var/unbound/usr/local/bin
                  /usr/local/lib                 227G     75G    133G    36%    /var/unbound/usr/local/lib
                  devfs                          1.0K      0B    1.0K     0%    /var/dhcpd/dev
                  
                  P 1 Reply Last reply Mar 11, 2025, 5:06 PM Reply Quote 0
                  • P
                    posix @posix
                    last edited by Mar 11, 2025, 5:06 PM

                    Hello, can anyone provide further guidance?

                    1 Reply Last reply Reply Quote 0
                    • P
                      posix
                      last edited by Mar 14, 2025, 3:11 AM

                      @bmeeks @michmoor @stephenw10

                      Sorry to blast, but looking for further guidance and next steps.

                      S 1 Reply Last reply Mar 14, 2025, 2:08 PM Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by Mar 14, 2025, 3:18 AM

                        I assume it resets if you reboot?

                        How long does it take to refill?

                        1 Reply Last reply Reply Quote 0
                        • bmeeksB
                          bmeeks
                          last edited by Mar 14, 2025, 1:11 PM

                          I would not conflate disk space consumption with swap file usage. Having large files on the disk does not necessarily relate to swap being used. Maybe if you were trying to load and view huge files, but the PHP GUI would probably crash first before it forced the OS into using swap.

                          Something with the number of active processes you have running is consuming the swap. You have a number of Snort processes showing in one of your screen captures. Do you actually have that many physical interfaces configured, or are you running Snort instances on multiple VLANs? If the latter, consider running a single Snort instance on the physical interface.

                          You also have a couple of other packages that are likely to use RAM aggressively. Taken all together, it appears you have more "stuff" running than you have enough physical RAM to accomodate- thus the need for swap usage.

                          P 1 Reply Last reply Apr 7, 2025, 4:30 PM Reply Quote 0
                          • S
                            SteveITS Galactic Empire @posix
                            last edited by SteveITS Mar 14, 2025, 2:09 PM Mar 14, 2025, 2:08 PM

                            @posix The 70G/75G is total disk usage not pfBlocker usage. Though that’s at least 10x a typical pfSense installation.

                            Try “du -h —max-depth=2 /“ At a command line and see what’s using 70GB and apparently increasing since your earlier post. Then keep going into the largest subdirectories.

                            Edit: and yeah, disk usage is not equal to RAM usage.

                            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!

                            1 Reply Last reply Reply Quote 0
                            • P
                              posix @bmeeks
                              last edited by Apr 7, 2025, 4:30 PM

                              @bmeeks @stephenw10 @michmoor

                              Just an update. I removed SNORT package and swap usage went down to %7

                              @bmeeks as you pointed I was using SNORT on a few vlan interfaces and subscribed to paid rules. Since SNORT is not going to be moving to newer releases in PFSENSE anytime soon and I have no technical justification to use it in my home network (LOL - I know, "But I wanted to learn"). Other real world problems take priority.

                              Will open another thread about file useage, thank you all for the pointer hopefully others will benefit from this thread.

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