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

    Unbound python mode in combination with pfBlockerNG wrote more than 40 TB (!) (was: What wrote 47 TB (!) in two years? 2.7.2)

    Scheduled Pinned Locked Moved General pfSense Questions
    20 Posts 7 Posters 1.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
      slu
      last edited by slu

      Hi,

      since my third SSD died in different pfSense setups we check the SMART status of an two year old pfSense system with the following packages installed:

      arpwatch
      Cron
      freeradius3
      nmap
      openvpn-client-export
      pfBlockerNG
      Service_Watchdog
      snort
      Status_Traffic_Totals
      System_Patches
      zabbix-agent6
      

      SMART show total write of 47 TB (!) in two years, no wonder my SSDs are die.
      The question is now, what write so much?

      Do SNORT write on the disk to check the data flow @bmeeks ?

      Edit: Modify topic subject.

      pfSense Gold subscription

      keyserK fireodoF bmeeksB 3 Replies Last reply Reply Quote 0
      • keyserK
        keyser Rebel Alliance @slu
        last edited by keyser

        @slu Snort might be the obvious culprit, but let me assure you, depending on your version and config of pfBlockerNG (obviously also the number of clients and traffic), it can absolutely lay waste to SSD’s if you fx. Ask it to do replylogging and have a lot of blocklists with standard logging turned on.
        I had a config where pfBlockerNG did around 400 KB/s sustained writes to my SSD 24/7 with just 50 clients on the network.
        That will total about 13 TB writes a year from pfBlockerNG alone.

        Love the no fuss of using the official appliances :-)

        S 2 Replies Last reply Reply Quote 0
        • S
          slu @keyser
          last edited by

          @keyser
          ok so I must check snort as next step.

          Available Spare:                    100%
          Available Spare Threshold:          10%
          Percentage Used:                    67%
          Data Units Read:                    22,535 [11.5 GB]
          Data Units Written:                 92,432,066 [47.3 TB]
          Host Read Commands:                 4,378,418
          Host Write Commands:                4,303,452,653
          Controller Busy Time:               42,328
          Power Cycles:                       25
          Power On Hours:                     13,114
          

          pfSense Gold subscription

          1 Reply Last reply Reply Quote 0
          • fireodoF
            fireodo @slu
            last edited by

            @slu said in What wrote 47 TB (!) in two years? 2.7.2:

            SMART show total write of 47 TB (!) in two years, no wonder my SSDs are die.
            The question is now, what write so much?

            Hi, if you dig in the Netgate Forum you'll find some threads concerning the huge amount of writing to SSDs/Disk ...

            Regards,
            fireodo

            Kettop Mi4300YL CPU: i5-4300Y @ 1.60GHz RAM: 8GB Ethernet Ports: 4
            SSD: SanDisk pSSD-S2 16GB (ZFS) WiFi: WLE200NX
            pfsense 2.7.2 CE
            Packages: Apcupsd Cron Iftop Iperf LCDproc Nmap pfBlockerNG RRD_Summary Shellcmd Snort Speedtest System_Patches.

            1 Reply Last reply Reply Quote 0
            • S
              slu @keyser
              last edited by slu

              @keyser said in What wrote 47 TB (!) in two years? 2.7.2:

              version and config of pfBlockerNG (obviously also the number of clients and traffic)

              I guess you are right, unbound and with it pfBlockerNG 3.2.0_8 (?) is the problem.
              Any hint to disable the logging?

              top -m io show:

              pfSense write 2024-08-18_12-10.png

              Enable remote logging is enabled to external syslog server.

              pfSense Gold subscription

              S GertjanG 2 Replies Last reply Reply Quote 0
              • S
                slu @slu
                last edited by slu

                Found it, as soon I switch from "unbound python mode" to "unbound mode" unbound stop permanent writing. I can confirm this on two different pfSense boxes with 2.7.2 CE.

                As @keyser wrote, this is a huge problem.
                https://forum.netgate.com/post/1027554

                pfSense Gold subscription

                w0wW 1 Reply Last reply Reply Quote 2
                • S slu referenced this topic on
                • w0wW
                  w0w @slu
                  last edited by

                  @slu
                  32TB writes since 2019 and no, in my case it's not unbound in first place, enabled python mode since it was introduced in pfblockerng btw.

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    slu @w0w
                    last edited by

                    @w0w
                    thanks for your reply, that's interesting.

                    On my smaller network (only ~ 8 systems online) I see write throughput of approximately 10. But on my bigger network (screenshot above) its continuity around 1400 write throughput.

                    pfSense Gold subscription

                    w0wW 1 Reply Last reply Reply Quote 0
                    • bmeeksB
                      bmeeks @slu
                      last edited by

                      @slu said in Unbound python mode in combination with pfBlockerNG wrote more than 40 TB (!) (was: What wrote 47 TB (!) in two years? 2.7.2):

                      Do SNORT write on the disk to check the data flow @bmeeks ?

                      No, Snort only writes what you see in the alert logs. It does no temporary writes other than when downloading and unpacking rules files updates. Those happen under /tmp and are cleaned up when the rules update completes. Snort logs are under /var/log/snort/.

                      S 1 Reply Last reply Reply Quote 1
                      • S
                        slu @bmeeks
                        last edited by

                        @bmeeks said in Unbound python mode in combination with pfBlockerNG wrote more than 40 TB (!) (was: What wrote 47 TB (!) in two years? 2.7.2):

                        No, Snort only writes what you see in the alert logs.

                        Thank you @bmeeks that confirmed what I see in top -m io with the Snort process.

                        pfSense Gold subscription

                        1 Reply Last reply Reply Quote 0
                        • w0wW
                          w0w @slu
                          last edited by

                          @slu
                          Long-term monitoring of disk writes still showed that a significant portion of them is performed unbound. I'm not sure what percentage of the records are unbound, but it is clear that it's substantial, though I don't know how to track it precisely. The Samsung SSD 860 PRO 256GB drives are in a ZFS mirror, and 88% of the resource remains, which is generally non-critical, but...

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

                            @slu said in Unbound python mode in combination with pfBlockerNG wrote more than 40 TB (!) (was: What wrote 47 TB (!) in two years? 2.7.2):

                            Any hint to disable the logging?

                            Just checking :

                            0bef5076-93bd-4ba2-ab41-273ab7a766cb-image.png

                            = unbound log level setting : Right ?

                            Level 3 and above logs a lot, and is only useful for temporary debug sessions. Setting it back to '1' is not 'optional'.

                            Btw : logs files, also the /var/log/resolver.log file, are rotated by pfSense.
                            My pfBlockerng log files (most of them are here /var/unbound/var/log/pfblockerng) are also rotated.
                            I've never, over a decade now, saw a Tbytes file size on my pfSense ...

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

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

                              @Gertjan said in Unbound python mode in combination with pfBlockerNG wrote more than 40 TB (!) (was: What wrote 47 TB (!) in two years? 2.7.2):

                              = unbound log level setting : Right ?

                              Yes setting is "Level 1", I tried also "Level 0" but unbound write anyway according to "top -m io".

                              Edit:
                              @Gertjan said in Unbound python mode in combination with pfBlockerNG wrote more than 40 TB (!) (was: What wrote 47 TB (!) in two years? 2.7.2):

                              I've never, over a decade now, saw a Tbytes file size on my pfSense ...

                              I do not have Tbytes file/log size on my pfSense, only see the SSD write TB's...

                              pfSense Gold subscription

                              w0wW 1 Reply Last reply Reply Quote 0
                              • w0wW
                                w0w @slu
                                last edited by

                                @slu
                                I know this might not solve the root problem, but what about looking for a really long-lasting SSD? Maybe some of the older, reliable MLC or SLC variants? Which form factor do you have?

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

                                  @slu Or perhaps a RAM disk.

                                  pfBlocker has some options that are on by default such as DNS Reply Logging to log all non-blocked queries (i.e. all valid DNS). Much like Suricata's HTTP request logging we disable that.

                                  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!

                                  S 1 Reply Last reply Reply Quote 0
                                  • S
                                    slu @SteveITS
                                    last edited by

                                    @SteveITS said in Unbound python mode in combination with pfBlockerNG wrote more than 40 TB (!) (was: What wrote 47 TB (!) in two years? 2.7.2):

                                    pfBlocker has some options that are on by default such as DNS Reply Logging to log all non-blocked queries (i.e. all valid DNS).

                                    I tried to disable this settings and reload pfBlockerNG + reboot pfSense, but unbound write and write again in python mode.

                                    pfSense Gold subscription

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

                                      @slu I don't know, have not noticed high disk writes. I have seen posts over the years though...here are a couple.

                                      https://www.reddit.com/r/pfBlockerNG/comments/13di9c2/dnsbl_python_mode_and_disk_writes/
                                      https://forum.netgate.com/topic/165993/should-i-be-using-unbound-python-mode-is-it-stable

                                      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!

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        slu @SteveITS
                                        last edited by

                                        @SteveITS
                                        thanks @SteveITS for the links.

                                        Still not sure whats the root cause for this massive writes on the SSD, maybe I'm on the wrong way with pfBlockerNG and Unbound Python mode...

                                        pfSense Gold subscription

                                        w0wW 1 Reply Last reply Reply Quote 0
                                        • w0wW
                                          w0w @slu
                                          last edited by

                                          @slu
                                          The settings can affect it. I just checked how often it updates. The Cron settings are set to once a day. This is probably significantly reducing the number of writes. Maybe there are some other settings that are affecting it as well.

                                          S 1 Reply Last reply Reply Quote 0
                                          • S
                                            slu @w0w
                                            last edited by

                                            New topic here to investigate the issue since pfBlockerNG is not the cause.
                                            https://forum.netgate.com/topic/189820/how-do-i-find-out-what-write-continuously-on-my-pfsense-ssd

                                            pfSense Gold subscription

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