RRD Tools


RRD::Editor

A free portable, standalone (no need for RRDs.pm) tool to create and edit RRD files. See RRD::Editor for more details, including downloads.

See rrdtool for more on RRDs and RRDTOOL.

Speed tests

Implementing RRD::Editor in Perl rather than C doesn't seem to incur much of a performance hit, at least based on the following measurements:

Portable RRD Files

RRD::Editor supports a couple of portable file formats (which actually just correspond to the native file format by RRDTOOL on Intel platforms). However, to interoperate with RRDTOOL we would also like it to support the non-portable file format used by RRDTOOL. This format is non-portable because it depends on some low-level details of the machine being used, especially:

The format also depends on the binary representation used for doubles, but this is not really a problem as all commonly used modern machines follow the IEEE 754 standard. Ditto the representation of chars and long ints. Importantly, pretty much everyone currently agrees that a double is 64 bits long and that a long int is either 32 bits or 64 bits.

Provided that the byte ordering and alignment choices above are all we need to be concerned with, then RRD::Editor should be able to figure out the non-portable format used by RRDTOOL on any specific machine, and so be able to read/write files in this format. The question is, are there other ordering/alignment options we need to take care of (that are used by modern machines rather than museum pieces, that is) ? The best way to find out is probably to check as many different platforms as possible. Below are data collected for a few different platforms, which basically consists of example non-portable RRD files with known contents (so they can be directly compared).

The following data was collected using t.pl.

Intel x686 32bit

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 2f 25 c0 c7 C 2b 1f 5b 4 0 0 0 5 0 0 0 2c 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 X 2 0 0 0 0 0 0 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 G A U G

Long Ints: 32bit, Doubles: 64bit
Byte ordering: little-endian 1234, Byte alignment: longs and doubles aligned at 32 bit boundaries


AMD64/Intel x86 64bit (Dell PowerEdge R300 Xeon 3GHz, Linux 2.6.32/Debian Squeeze)

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 2f 25 c0 c7 C 2b 1f 5b 4 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 2c 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 X 2 0 0 0 0 0 0 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0

Long Ints: 64bit, Doubles: 64bit
Byte ordering: little-endian 12345678, Byte alignment: longs and doubles aligned at 64 bit boundaries

AMD64/Intel x86 64bit (MacBook Pro Core2 Duo 2.66GHz, Darwin 11.2.0/MAC OS X 10.7.2)

As above.


ARMv5, 32bit, ABI

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 C 2b 1f 5b 2f 25 c0 c7 4 0 0 0 5 0 0 0 2c 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 X 2 0 0 0 0 0 0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 G A U G

Long Ints: 32bit, Doubles: 64bit
Byte ordering: little-endian except for doubles, which are mixed-endian; Byte alignment: longs and doubles aligned at 32 bit boundaries


ARMv6, 64bit (Raspberry Pi, Debian Linux))

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 2f 25 c0 c7 C 2b 1f 5b 4 0 0 0 5 0 0 0 2c 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 X 2 0 0 0 0 0 0 0 0 0 0 0 0 f8 7f 0 0 0 0 0 0 f8 7f 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0

Long Ints: 32bit, Doubles: 64bit
Byte ordering: little-endian 1234; Byte alignment: longs aligned at 32 bit boundaries and doubles aligned at 64 bit boundaries


MIPS32, 24K processor (Malta)

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 5b 1f 2b C c7 c0 25 2f 0 0 0 4 0 0 0 5 0 0 1 2c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 X 0 0 0 0 7f f7 ff ff ff ff ff ff 7f f7 ff ff ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0

Long Ints: 32bit, Doubles: 64bit
Byte ordering: big-endian 4321, Byte alignment: longs aligned at 32 bit boundaries and doubles aligned at 64 bit boundaries


MIPS64, R12000 processor (SGI Octane 2, Irix 6.5)

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 5b 1f 2b C c7 c0 25 2f 0 0 0 4 0 0 0 5 0 0 1 2c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 X 0 0 0 0 7f f7 ff ff ff ff ff ff 7f f7 ff ff ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0

Long Ints: 32bit, Doubles: 64bit
Byte ordering: big-endian 4321, Byte alignment: longs aligned at 32 bit boundaries and doubles aligned at 64 bit boundaries


Alpha, 21164 (EV5) processor (DEC Personal Workstation 433au, NetBSD 5.1.2)

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 2f 25 c0 c7 C 2b 1f 5b 4 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 2c 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 X 2 0 0 0 0 0 0 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0

Long Ints: 64bit, Doubles: 64bit
Byte ordering: little-endian 12345678, Byte alignment: longs and doubles aligned at 64 bit boundaries


PowerPC, 32bit

See machine details.

RRD Test File:  test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 5b 1f 2b C c7 c0 25 2f 0 0 0 4 0 0 0 5 0 0 1 2c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 X 0 0 0 0 ff f8 0 0 0 0 0 0 ff f8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0

Long Ints: 32bit, Doubles: 64bit
Byte ordering: big-endian 4321, Byte alignment: longs aligned at 32 bit boundaries and doubles at 64 bit boundaries


TurboSPARC MB86907 (Sparcstation 5, NetBSD 5.1.2, 32 bit)

See machine details.

RRD Test File: test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 5b 1f 2b C c7 c0 25 2f 0 0 0 4 0 0 0 5 0 0 1 2c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 X 0 0 0 0 7f ff ff ff ff ff ff ff 7f ff ff ff ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0

Long Ints: 32bit, Doubles: 64bit
Byte ordering: big-endian 4321, Byte alignment: longs aligned at 32 bit boundaries and doubles at 64 bit boundaries


UltraSPARC-II (Sun Ultra-80, Solaris 5.10, 64 bit)

See machine details.

RRD Test File: test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 5b 1f 2b C c7 c0 25 2f 0 0 0 4 0 0 0 5 0 0 1 2c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 X 0 0 0 0 7f ff ff ff ff ff ff ff 7f ff ff ff ff ff ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0 0 0 0 0 0 0 0 0

Long Ints: 32bit, Doubles: 64bit
Byte ordering: big-endian 4321, Byte alignment: longs aligned at 32 bit boundaries and doubles at 64 bit boundaries


Itanium (DELL Poweredge 3250, Linux 2.6.32-5-mckinley/Debian Speedy)

See machine details.

RRD Test File: test.rrd   test.xml

Dump of first 256 bytes of file header:
R R D 0 30 30 30 33 0 0 0 0 0 0 0 0 2f 25 c0 c7 C 2b 1f 5b 4 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 2c 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C O U N T E R 0 0 0 0 0 0 0 0 0 0 0 0 0 X 2 0 0 0 0 0 0 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 f8 ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 e l 32 0 0 0 0 0

Long Ints: 64bit, Doubles: 64bit
Byte ordering: little-endian 12345678, Byte alignment: longs and doubles aligned at 64 bit boundaries


Feel free to run the t.pl script to collect data for your own machine, and if its not already on the list above I'd be more than happy to post it here. The dumplfile.pl script can be used to inspect the binary rrd files directly.