[rrd-users] Question about RRDTool ..

Simon Hobson linux at thehobsons.co.uk
Thu Mar 20 08:59:06 CET 2008

Jean-Yves Avenard wrote:

>Unfortunately, this doesn't seem to work properly.
>For a start I recorded the maximum and minimum value aren't correct,
>they are rounded.
>Like the maximum in my case should be 1267.13 but it shows as 1266 
>on the graph.
>rrdtool fetch speed.rrd AVERAGE
>timestamp    local             remote
>1205895600:  1.2642200000e+03  1.6115000000e+02
>1205906400:  1.2642200000e+03  1.6115000000e+02
>1205917200:  1.2642200000e+03  1.6115000000e+02
>1205928000:  1.2642200000e+03  1.6115000000e+02
>1205938800:  1.2642200000e+03  1.6115000000e+02
>1205949600:  1.2642200000e+03  1.6115000000e+02
>1205960400:  1.2642200000e+03  1.6115000000e+02
>1205971200:  1.2661600000e+03  1.6115666667e+02
>1205982000:  nan  nan
>1205992800:  nan  nan
>I ran manually the command:
>rrdtool update /var/www/html/adslstats/speed.rrd 1205974800:1267.13:161.16
>so where is my 1267.13 ??
>Then, in the graph itself, the line stop at what is 11AM.
>Did I miss anything in the create of the round robin database? Did I
>just misunderstand something in the documentation (I did read it over
>and over to make sure I didn't make a stupid mistake).

1205974800 is not a multiple of your interval period, therefore 
normalisation WILL be done on the data and you will NOT get out 
exactly the same values you put in. Go to the rrd website and look up 
the tutorial on normalisation.

Your graph will stop at the last completed sample period. According 
to your mail headers, you are in timezone +11, so 11am is a multiple 
of 3 hours UTC. As your later email shows, when another 3 hour sample 
period is complete, the graph will include it. If you want better 
resolution then you need to store data at a better resolution.

Lastly, it's a good idea to explicitly round your graph end time to 
be exactly on the end of a step boundary, and your start time to be 
exactly an integer number of steps before the end. Under some 
circumstances, rrdtool will choose a lower resolution of data for 
plotting if it fills more of the graph.

>I created my RRD database like this:
>rrdtool create speed.rrd -s 10800 \
>DS:local:GAUGE:86400:0:2500 \
>DS:remote:GAUGE:86400:0:2500 \
>RRA:AVERAGE:0.5:1:2928 \
>RRA:AVERAGE:0.5:8:31 \
>RRA:AVERAGE:0.5:56:5 \
>RRA:AVERAGE:0.5:248:12 \
>RRA:MIN:0.5:1:2928 \
>RRA:MIN:0.5:8:31 \
>RRA:MIN:0.5:56:5 \
>RRA:MIN:0.5:248:12 \
>RRA:MAX:0.5:1:2928 \
>RRA:MAX:0.5:8:31 \
>RRA:MAX:0.5:56:5 \
>So I have the average, min and max value collected as follow:
>data collected every 3 hours (10800 seconds)
>for 1 year (2928 x 3 hours = 366 days)
>sampled over 1 day (8 records) kept for 31 days
>sampled over 1 week kept for 5 weeks
>sampled over 1 month kept for 12 month.

Lastly, you are missing the point of rrds consolidation functions 
here. Normally, the issue is that you don't want the storage overhead 
of storing high resolution data over a long period - hence you would 
store high res data for only a few days, medium res data for a few 
weeks, and low res data for a year or two. In this case, you are 
storing your highest resolution data for a full year - so there is 
little point storing the other rras.

You do NOT have to store the 3 hours data for the full year in order 
to have the other consolidations available.

The only gain you get here is that by carefully selecting your 
graphing periods/sizes, you can avoid query-time consolidation of the 
data and improve graphing speeds. Since you aren't even specifying 
start and end times, you certainly aren't taking advantage of this 

More information about the rrd-users mailing list