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

    23.1 using more RAM

    Scheduled Pinned Locked Moved General pfSense Questions
    98 Posts 17 Posters 67.2k 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.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      It would require an extremely unorthodox install to get ZFS on a 3100. I won't say it's impossible because I'm sure someone would prove me wrong! But it would require a significant level of FreeBSD knowledge to even know where to start. So it's probably just a misunderstanding.

      1 Reply Last reply Reply Quote 2
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        Looks like from the periodic scripts the pkg related ones in /usr/local/etc/periodic/security are the ones that seems to trigger it for me. They use pkg to validate parts of the system in various ways, but we don't do anything with the output so it is really unnecessary.

        Someone who is seeing this, try creating /etc/periodic.conf with the following content:

        security_status_baseaudit_enable="NO"
        security_status_pkg_checksum_enable="NO"
        security_status_pkgaudit_enable="NO"
        

        And then reboot and watch it overnight (or try periodic daily from a shell prompt, I suppose)

        You can also knock the ARC usage back down by setting a lower limit than you have now which is almost certainly 0 (unlimited) which is the default. So you can do this to set a 256M limit:

        sysctl vfs.zfs.arc_max='268435456'
        

        You can set it back to 0 to remove the limit after making sure the ARC usage dropped back down.

        All that said, I still can't reproduce it being a problem source here. I have some small VMs with ~1GB RAM and ZFS and their wired usage is high but drops immediately when the system needs active memory.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        johnpozJ S 2 Replies Last reply Reply Quote 1
        • S SteveITS referenced this topic on
        • S SteveITS referenced this topic on
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @jimp
          last edited by

          @jimp said in 23.1 using more RAM:

          their wired usage is high but drops immediately when the system needs active memory.

          I think this is part of the problem to be honest - users hate to see all their memory being used for whatever reason ;) Even if something is using it because nothing else is needing any memory and if that something needs it will be freed up for that something.

          Just memory use showing high seems to trigger something is wrong in the users perspective.

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          jimpJ 1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate @johnpoz
            last edited by

            @johnpoz said in 23.1 using more RAM:

            @jimp said in 23.1 using more RAM:

            their wired usage is high but drops immediately when the system needs active memory.

            I think this is part of the problem to be honest - users hate to see all their memory being used for whatever reason ;) Even if something is using it because nothing else is needing any memory and if that something needs it will be freed up for that something.

            Just memory use showing high seems to trigger something is wrong in the users perspective.

            Right, "Free RAM is wasted RAM" and all, but some people are implying that it isn't giving up the memory on their systems or it's causing other problems such as interfering with traffic, but it's not clear if there is a direct causal link here yet. But if we can reduce/eliminate the impact of ARC as a potential cause it will at least help narrow down what those others issues might be.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            johnpozJ 1 Reply Last reply Reply Quote 1
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @jimp
              last edited by johnpoz

              @jimp all true..

              X doesn't work - oh my memory use is showing 90% that must be it.. When that most likely has nothing to do with X.. But sure if you can reduce it so memory is only showing 10% used and still have X then more likely to look deeper to that is actually causing their X issue.

              edit:
              Just an attempt to put it another way, not trying to mansplain it to you hehehe ;) ROFL..

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              1 Reply Last reply Reply Quote 0
              • F
                FSC830
                last edited by

                OMG... you mean...
                the memory is sucked by extra terrestrials? 😰
                Or why do you refer to the X-files?

                🤡

                SCNR

                Regards

                P 1 Reply Last reply Reply Quote 0
                • P
                  pmagid @FSC830
                  last edited by

                  @fsc830 Maybe they have balloons....

                  1 Reply Last reply Reply Quote 1
                  • DefenderLLCD
                    DefenderLLC
                    last edited by DefenderLLC

                    The facts are something changed on my 6100 MAX between 22.05 and 23.01 that has essentially doubled my memory utilization at 3AM and never returns to normal without a reboot only to repeat itself again at 3AM.

                    Is it causing me a problem today? No, but it does bother me when I go from 18% to almost 40% for no apparent reason. This is clearly happening on other Netgate appliances too. Thanks, guys.

                    8b62fcd6-faa2-4fc1-b1c9-e262877ffcb5-image.png

                    1 Reply Last reply Reply Quote 0
                    • jimpJ
                      jimp Rebel Alliance Developer Netgate
                      last edited by

                      Right but we still don't know if you have a problem or the perception of a problem. It's almost certainly the latter.

                      It looks like on 22.05 those periodic jobs were all entirely disabled but it's not clear where that change got lost, since the file hasn't changed upstream.

                      For now you can edit /etc/crontab and remove the periodic lines or comment them out -- do not touch the rc.periodic lines as those are OK.

                      Before:

                      # Perform daily/weekly/monthly maintenance.
                      1	3	*	*	*	root	periodic daily
                      15	4	*	*	6	root	periodic weekly
                      30	5	1	*	*	root	periodic monthly
                      

                      After

                      # Perform daily/weekly/monthly maintenance.
                      #1	3	*	*	*	root	periodic daily
                      #15	4	*	*	6	root	periodic weekly
                      #30	5	1	*	*	root	periodic monthly
                      

                      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      DefenderLLCD 1 Reply Last reply Reply Quote 1
                      • DefenderLLCD
                        DefenderLLC @jimp
                        last edited by

                        @jimp said in 23.1 using more RAM:

                        /etc/crontab

                        Just made those edits to the crontab file and will reboot these evening. Thanks, Mr. P!

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

                          @jimp said in 23.1 using more RAM:

                          try creating /etc/periodic.conf with the following content

                          @jrey said in 1100 upgrade, 22.05->23.01, high mem usage:

                          Yup I went a little further in testing, and pin pointed the exact step.
                          But I also then just disabled the 450.status-security in the config.
                          as it was configured out of box as (mail root) no one would ever see the output anyway.
                          following through I also sent the output to log files so in case I might like to look at it one day (NOT)
                          this thread details all the steps I took and at what point it breaks, the settings quoted on the reference thread will do the same as disabling 450.status-security
                          there is nothing to see there anyway, especially as configured out of box.
                          security_status_baseaudit_enable="NO"
                          security_status_pkg_checksum_enable="NO"
                          security_status_pkgaudit_enable="NO"

                          Agree it's not a "problem" unless one needs the memory. However, 1100 users are probably more sensitive to memory usage...that's one reason we sold 2100s instead. :) It looks alarming on the graph but at least with 4 GB, for most people it's a bit irrelevant if 30% or 50% is in use.

                          However if as jrey says it's an unused feature then it shouldn't hurt to disable it.

                          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!

                          DefenderLLCD 1 Reply Last reply Reply Quote 0
                          • DefenderLLCD
                            DefenderLLC @SteveITS
                            last edited by

                            @steveits said in 23.1 using more RAM:

                            @jimp said in 23.1 using more RAM:

                            try creating /etc/periodic.conf with the following content

                            @jrey said in 1100 upgrade, 22.05->23.01, high mem usage:

                            Yup I went a little further in testing, and pin pointed the exact step.
                            But I also then just disabled the 450.status-security in the config.
                            as it was configured out of box as (mail root) no one would ever see the output anyway.
                            following through I also sent the output to log files so in case I might like to look at it one day (NOT)
                            this thread details all the steps I took and at what point it breaks, the settings quoted on the reference thread will do the same as disabling 450.status-security
                            there is nothing to see there anyway, especially as configured out of box.
                            security_status_baseaudit_enable="NO"
                            security_status_pkg_checksum_enable="NO"
                            security_status_pkgaudit_enable="NO"

                            Agree it's not a "problem" unless one needs the memory. However, 1100 users are probably more sensitive to memory usage...that's one reason we sold 2100s instead. :) It looks alarming on the graph but at least with 4 GB, for most people it's a bit irrelevant if 30% or 50% is in use.

                            However if as jrey says it's an unused feature then it shouldn't hurt to disable it.

                            Just rebooted after making those changes. I will report back here tomorrow morning!

                            1 Reply Last reply Reply Quote 0
                            • Dobby_D
                              Dobby_
                              last edited by

                              80c248ee-6cff-4fc0-b6c7-581688abfb31-image.png

                              After some time and all packets up to date (yesterday)
                              all went fine again, there is not so high usage of RAM (90%)
                              and Swap will be also not reaching out of space on top of
                              all the CPU is going back to normal too.

                              All in all, now the specs will be normal again like before
                              the update to 23.01.

                              Never again I will go with hard soldered RAM, the next
                              box will be sorted with upgrade able memory banks.

                              #~. @Dobby

                              Turris Omnia - 4 Ports - 2 GB RAM / TurrisOS 7 Release (Btrfs)
                              PC Engines APU4D4 - 4 Ports - 4 GB RAM / pfSense CE 2.7.2 Release (ZFS)
                              PC Engines APU6B4 - 4 Ports - 4 GB RAM / pfSense+ (Plus) 24.03_1 Release (ZFS)

                              1 Reply Last reply Reply Quote 0
                              • jimpJ
                                jimp Rebel Alliance Developer Netgate
                                last edited by jimp

                                Honestly the cron thing is mostly a perception thing as well -- it just keeps a high disk activity job from crunching all the data on the disk and thus driving up ARC. Any high disk activity job could do it over time.

                                The real "solution" here is for you do tune the value of things like vfs.zfs.arc_max to levels you are comfortable with on your setup so it doesn't grow larger than you think it should. Note the weasel words there as that's primarily not a technical limit it will just give you a warm fuzzy feeling about not letting your RAM be used for caching to speed things up :-)

                                I opened https://redmine.pfsense.org/issues/14016 to address the cron changes.

                                You can install the System Patches package and then create an entry for ff715efce5e6c65b3d49dc2da7e1bdc437ecbf12 to apply the fix. After applying the patch you can either reboot or if you have the cron package installed, edit and save a job (without making changes) to trigger a rewrite of the cron config.

                                EDIT: For good measure I went back to a 22.05 ZFS install and ran periodic daily and ZFS ARC+wired usage shot up like mad, so even though the underlying behavior is the same, disabling the cron job should at least get back to not having it run ARC up every night.

                                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                Need help fast? Netgate Global Support!

                                Do not Chat/PM for help!

                                DefenderLLCD P bingo600B 3 Replies Last reply Reply Quote 6
                                • DefenderLLCD
                                  DefenderLLC @jimp
                                  last edited by

                                  @jimp said in 23.1 using more RAM:

                                  Honestly the cron thing is mostly a perception thing as well -- it just keeps a high disk activity job from crunching all the data on the disk and thus driving up ARC. Any high disk activity job could do it over time.

                                  The real "solution" here is for you do tune the value of things like vfs.zfs.arc_max to levels you are comfortable with on your setup so it doesn't grow larger than you think it should. Note the weasel words there as that's primarily not a technical limit it will just give you a warm fuzzy feeling about not letting your RAM be used for caching to speed things up :-)

                                  I opened https://redmine.pfsense.org/issues/14016 to address the cron changes.

                                  You can install the System Patches package and then create an entry for ff715efce5e6c65b3d49dc2da7e1bdc437ecbf12 to apply the fix. After applying the patch you can either reboot or if you have the cron package installed, edit and save a job (without making changes) to trigger a rewrite of the cron config.

                                  EDIT: For good measure I went back to a 22.05 ZFS install and ran periodic daily and ZFS ARC+wired usage shot up like mad, so even though the underlying behavior is the same, disabling the cron job should at least get back to not having it run ARC up every night.

                                  Glad you were able to replicate it. I edited the crontab file and commented out those 3 lines and rebooted. Will report back tomorrow morning! Thank you, Mr. P.!

                                  1 Reply Last reply Reply Quote 0
                                  • S SteveITS referenced this topic on
                                  • S SteveITS referenced this topic on
                                  • S SteveITS referenced this topic on
                                  • S SteveITS referenced this topic on
                                  • S SteveITS referenced this topic on
                                  • P
                                    Patch @jimp
                                    last edited by Patch

                                    @jimp said in 23.1 using more RAM:.

                                    … there as that's primarily not a technical limit it will just give you a warm fuzzy feeling about not letting your RAM be used for caching to speed things up :- …

                                    While for a static system this is technically correct. However in a real time software system there is a difference between

                                    • currently free memory and
                                    • could be made available if required.

                                    The difference is essentially time, how long does the requesting process have to be stalled waiting for the required memory to be allocated to it. Where will this memory be allocated from, swap or zfs buffer garbage collection. Does this delay reduced throughput, or result in intermittent data loss / or crashes.

                                    Where the memory is being used for user measurable device performance enhancement then the trade off can be justified. When it only helps after hours housekeeping, the cost is harder to justify. When it is used for redundant task run once a day, I’m at a loss to know any way of justify it.

                                    Ideally ARC would release cache which is very rarely used but I’m not aware of that option being supported. The closest I have found is to manually set the ARC upper buffer limit to cover active buffer use, forcing ARC to prune rarely used buffer data. By default ARC uses 50% of all available ram to accelerate disk access. For a real time system such as pfsense which is not disk access limited, this is unlikely to be optimal. In the past pfsense severely restricted ARC buffer size however this appears to have been removed from the latest version. Looks like a regression to me.

                                    1 Reply Last reply Reply Quote 0
                                    • bingo600B
                                      bingo600 @jimp
                                      last edited by bingo600

                                      @jimp said in 23.1 using more RAM:

                                      it just keeps a high disk activity job from crunching all the data on the disk and thus driving up ARC. Any high disk activity job could do it over time.

                                      Hmmm ....

                                      I have used ZFS since 2.4.5-p1.

                                      I noticed a jump in ram consumption, when i switched to pfSense+ (22.??) first plus.
                                      I have 8GB installed, and am quite sure i was using around 18% when on 2.6.0.

                                      When i switched to Plus, it started out somewhat the same 18% , but during the next days it would gradually increase to around 40..43% usage, but it stayed there ... So it didn't look like a leak.
                                      And i was not too worried, as it seemed stable at around low 40%., and i still had 4GB free.

                                      I have NtopNG active on 20+ interfaces, and it seems like it starts a process per interface that gobbles up some mem,
                                      But if NtopNG also logs the collected data to disk, then combined with the "ZFS & Disk Activity statement above" , that could be the reason for the increased usage.

                                      This is my 23.01 Test Box (i3 / 8GB Ram) running my "home config" , uptime around 2 days
                                      Dashboard shows 39% Mem usage.

                                      Home 23.01 - i3/8G Ram - Uptime 2 days
                                      c3434bae-eb06-4ddb-b6f0-9d61e7a470c6-image.png

                                      .
                                      .
                                      .

                                      This is my 22.05 Summerhouse Box (i5 / 8GB Ram) running my "summerhouse config" , uptime 173 days 👍
                                      Dashboard shows 46% Mem usage.

                                      Summerhouse - 22.05 - i5/8G Ram - Uptime 173 days 👍
                                      a311dacd-238d-4c9b-9439-8bd4d8757396-image.png

                                      Both w. NtopNG and 20+ Vlans , and running basically the same config.
                                      Both are (sys)logging to a "remote linux" ...

                                      /Bingo

                                      If you find my answer useful - Please give the post a 👍 - "thumbs up"

                                      pfSense+ 23.05.1 (ZFS)

                                      QOTOM-Q355G4 Quad Lan.
                                      CPU  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                                      LAN  : 4 x Intel 211, Disk  : 240G SAMSUNG MZ7L3240HCHQ SSD

                                      1 Reply Last reply Reply Quote 0
                                      • Dobby_D Dobby_ referenced this topic on
                                      • jimpJ
                                        jimp Rebel Alliance Developer Netgate
                                        last edited by

                                        As I mentioned above, if the wired usage is from ZFS ARC, you have the option to tune its usage at any time by setting a tunable for vfs.zfs.arc_max to a specific number of bytes (e.g. 268435456 for 256M). On FreeBSD 14 that isn't a loader tunable like it was on older versions, you can change the value live and it is immediately respected.

                                        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                        Need help fast? Netgate Global Support!

                                        Do not Chat/PM for help!

                                        DefenderLLCD 1 Reply Last reply Reply Quote 4
                                        • DefenderLLCD
                                          DefenderLLC @jimp
                                          last edited by

                                          @jimp said in 23.1 using more RAM:

                                          As I mentioned above, if the wired usage is from ZFS ARC, you have the option to tune its usage at any time by setting a tunable for vfs.zfs.arc_max to a specific number of bytes (e.g. 268435456 for 256M). On FreeBSD 14 that isn't a loader tunable like it was on older versions, you can change the value live and it is immediately respected.

                                          Mystery solved. Disabling the periodic cron jobs fixed the issue. Thank you for your help, Mr. P!

                                          IMG_1596.jpeg

                                          1 Reply Last reply Reply Quote 1
                                          • jimpJ
                                            jimp Rebel Alliance Developer Netgate
                                            last edited by

                                            Good to know that disabling the unnecessary cron bits helped, but be aware that any process that heavily hits the disk will trigger similar high ARC usage in the future as it tries to cache data.

                                            If you are worried about the wired usage, I still recommend setting a value for vfs.zfs.arc_max to whatever amount of your RAM you feel comfortable with it using. Higher values will result in overall better disk performance, but disk performance isn't usually important for most firewall roles.

                                            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                            Need help fast? Netgate Global Support!

                                            Do not Chat/PM for help!

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