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

    RRD RAM Disk Backup/Restore

    Scheduled Pinned Locked Moved Development
    6 Posts 3 Posters 2.1k 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.
    • N
      NOYB
      last edited by

      When backing up and restoring RRD for the RAM disk what is the purpose behind backing up and restoring as XML by using rrddump and rrdrestore rather than the RRD files directly?

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

        An XML dump from rrdtool is architecture-independent, so it can be stored from 32-bit and restored to 64-bit or vice versa. That's how it's stored in the config.xml backup when the option is enabled also.

        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
        • N
          NOYB
          last edited by

          Thanks Jim.  So is there a use case for doing the rrddump in the reboot/shutdown/periodic backup for ram disk instead of the *.rrd files directly?  Would make that process cleaner, and straight forward without the rrddump.

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

            I seem to recall it was done for safety reasons, it was easier for rrdtool to recover partial data/files from xml than the raw rrd, but I might be misremembering that.

            Might have also been that the backup function was re-used so it was the same, rather than having two different means of backing up rrd depending on the context.

            I'd have to go digging through the code for a better answer, but ultimately it seems like using dump/restore is the more proper way rather than copying the binary files around.

            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
            • C
              cmb
              last edited by

              @NOYB:

              Thanks Jim.  So is there a use case for doing the rrddump in the reboot/shutdown/periodic backup for ram disk instead of the *.rrd files directly?  Would make that process cleaner, and straight forward without the rrddump.

              Wouldn't be a good idea. That's a lot of processing for no reason in that case. It's fast and low-resource to copy the rrd files, doing a dump and restore chews up CPU and RAM. In the past, at times enough RAM that it runs an ALIX out of RAM and kills off the process. Good chance of data issues on low RAM systems if you did a dump on every shut down and restore at boot up.

              1 Reply Last reply Reply Quote 0
              • N
                NOYB
                last edited by

                @cmb:

                @NOYB:

                Thanks Jim.  So is there a use case for doing the rrddump in the reboot/shutdown/periodic backup for ram disk instead of the *.rrd files directly?  Would make that process cleaner, and straight forward without the rrddump.

                Wouldn't be a good idea. That's a lot of processing for no reason in that case. It's fast and low-resource to copy the rrd files, doing a dump and restore chews up CPU and RAM. In the past, at times enough RAM that it runs an ALIX out of RAM and kills off the process. Good chance of data issues on low RAM systems if you did a dump on every shut down and restore at boot up.

                That's how it's currently being done.  So should it be changed?  Just tar the *.rrd files and do away with the rrdtool dump at shutdown and rrdtool restore at boot up?

                In the ram disk management commit/pr submitted it should be pretty easy eliminate the rrdtool dump/restore on shutdown/boot up.

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