December 2011 Archives

rrdtool create

| No Comments | No TrackBacks
rrdtool is a software to help you measure and graph things. I've just read a blog post from the currently running LISA conference, that I thought was very helpful. From that I learned about the rrdtool create command, which I wanted to write here for my own reference.

Given this command:
$ rrdtool create first.rrd -step=300 \
DS:speed:GAUGE:500:0:300 \
RRA:AVERAGE:0.5:1:120 \
This creates an rrd (Round Robin Database) file. The file expects to receive every 300 seconds, the --step interval.

The DS is a Data Source called speed, of type GAUGE, and it's 500:0:300 parameters mean new data should arrive no later than every 500 seconds, the minimum value acceptable is 0 and the maximum value acceptable is 300.

The two RRA (Round Robin Archives) define how the data is actually stored into an archive. This RRD has two archives. The first archive takes the AVERAGE of any data that comes in, that at least half of the data has to be known (not unknown) to be stored meaningfully, and that data will be stored every 1 intervals (so once every 5 minutes), for 120 entries (10 hours of data will be kept). The second RRA keeps data for ever 12 intervals (so one datapoint for every hour) for 96 entries (ie 4 days).

So if this RRD was full of data, and you graphed it, you'd have 10 hours of data that you could zoom into to a 5 minute resolution, and a further 4 days of data you could zoom into at one hour resolution.