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

  • 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?

  • 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

    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.

  • 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.

  • Rebel Alliance Developer Netgate

    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.

Log in to reply