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

    V2.1 - SSD friendly use of RAM disks - questions

    Problems Installing or Upgrading pfSense Software
    3
    4
    2.0k
    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.
    • stan-qazS
      stan-qaz
      last edited by

      I noticed this addition here:  http://blog.pfsense.org/?p=712 and the settings for it on my pfSense box here: pfsense/system_advanced_misc.php

      Add optional ability for full installs to use RAM disks for /var/ and /tmp/ as is done on NanoBSD. Reduces overall writes to the media, should be more SSD-friendly

      I set mine up to 5X the minimum recommended size (200 and 300 MB) since I have lots of open RAM. My system hasn't been rebooted long or very busy so the usage is still pretty low.

      Output from df -h:

      
      /dev/md0        193M     88k    177M     0%    /tmp
      /dev/md1        290M     16M    250M     6%    /var
      
      

      Question: Is there a sweet spot that I should shoot for or just set them large enough that they don't fill up before being flushed?

      Just below the drive size settings is an option for the RRD graph data write intervals.

      This will periodically backup the RRD data so it can be restored automatically on the next boot. Keep in mind that the more frequent the backup, the more writes will happen to your media.

      Question: Is this data also backed up if you reboot from the console or the web interface?

      If it isn't automatically done is there a way to trigger a backup before you reboot?

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        Question: Is this data also backed up if you reboot from the console or the web interface?

        In /etc/rc.reboot and /etc/rc.shutdown

        # If we are not on a full install, or if the full install wants RAM disks, or if the full install _was_ using RAM disks, but isn't for the next boot...
        if [ "${PLATFORM}" != "pfSense" ] || [ ${USE_MFS_TMPVAR} -gt 0 ] || [ "${DISK_TYPE}" = "md" ]; then
                /etc/rc.backup_rrd.sh
                /etc/rc.backup_dhcpleases.sh
        fi
        
        

        Yes, on a clean shutdown or reboot it saves RRD and DHCP lease data.
        If, like me, you get unexpected power interruptions and care about the RRD data, then use the periodic backup also.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • stan-qazS
          stan-qaz
          last edited by

          Great, I'll set it for four hours and see how that goes. Thanks for the info on where to look for this stuff too.

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

            For sizing, it really depends on a few factors. The most important is how many packages you are going to install and what packages they are.

            If you run something like squid, you'll need a LOT more /var space. If you install large packages, you'll need to have more room there for the install process in /var and /tmp to manage the files they grab.

            Log files and RRD do not grow once they are initialized. If you add an interface or a gateway, you would gain some more RRD graphs, but that doesn't happen too often, and you'd have to have your drives nearly full for that to be a concern.

            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!

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