[rrd-users] Noob questions about number of rows to create.

Simon Hobson linux at thehobsons.co.uk
Mon Jun 13 20:17:39 CEST 2011

Craig Smith wrote:

>I'm tying to create and RRD for keeping track of an Ethernet interface
>at intervals of 15 second, and I don't know how many rows to keep for
>the 1 min, 5 min, 15 min, 1 hour, and 1 day averages I am keeping.
>Would someone please explain to me how to pick a proper amount of rows
>for an archive

OK, you've decided you want to be able to draw a graph (or do 
something else) at those resolutions. For how long do you want to be 
able to do that ?

Eg, for the 1 min data, how long after the fact do you want to be 
able to view that ?
At one extreme, you might use it to show network traffic over the 
last half hour, and that's it - once past there you don't care about 
that level of detail. So for that you might only store 60 samples - 
ie the last hour.
On the other hand, you might want to be able to come back in a weeks 
time and see what happened, in detail, a week previously. To do that 
you'd need to keep 60*24*7 = 10080 samples.

Repeat for each resolution.

In other words, answer the question "what do I want to do with this data ?"

Only you can answer that. RRD will do what *you* want. There is 
however a tradeoff simply because more data means larger files and 
potentially significantly more processing.

While it could be tempting to just keep two years worth of 1 minute 
data, that would be over a million records. If you kept *only* that 
data, then each time you drew a graph, RRD would have to calculate 
the data needed to draw the graph - so if you drew a graph covering a 
year, with one pixel per day, RRD would have to combine 1440 samples 
for each pixel of the graph - or over half a million samples 
altogether. Better for that to get RRD to store one value per day 
(something it is efficient at doing, and each day would be calculated 
only once), and have very little processing to do when you graph it.

Conversely, you cannot graph what you haven't stored. So if you want 
to be able to go back a month and graph data at 1 minute resolution, 
you've got to keep that whole months worth of 1 minute values.

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the rrd-users mailing list