[rrd-users] changing step time?

Simon Hobson linux at thehobsons.co.uk
Sat Apr 10 15:54:00 CEST 2010

Gregory Guthrie wrote:

>  > > "step" - specifically what happens if values are fed in more often?
>>  Step is the size of each bin in the database - ie the length of each
>>  time slot for which it can store data. Anything you feed it more
>>  often that the step time is accumulated until the period is complete
>>  and then it's all used to work out the single value stored for that
>>  bin.
>>  Eg, if you feed in values of 0,0,5,0,0 which all fit within one step
>>  time, then the min, max, and average are all 1.
>This is a surprise! It would certainly appear at first glance that 
>the max/min were 5 & 1.

RRD does not store anything but an accumulator within a step - so if 
you feed in those 5 values, the accumulator will hold the values 0, 
0, 5, 5, 5 immediately after each update. At the end of the step, 
we've told it about 5 <somethings> in total, and if the step were 5 
then the overall rate during the step is 1. Consolidate that with 
min, max, or average, and you still get 1.

I think it will be clearer when you've read Alex's tutorial on normalisation.

Alex van den Bogaerdt wrote:

>  >> I think you have to dump the data then do one of two things :
>>>  1) create a new database and feed the old data in
>>>  2) edit the data and re-import it
>>  My data comes from a live feed source, is there any standard way to export
>>  from rrd in a manner that allows re-import?
>>  I suppose one could write something that would do fetches from the old,
>>  and updates into the new.
>The biggest challenge is to get MIN and MAX correct.

In a situation like that, you would have to accept that the data 
doesn't exist. In changing from a step of 1 (day, hour, whatever) to 
half then the only sensible way I could see would be to simply 
duplicate each set of values - so at time 0.5 you insert the values 
you had at time 1, and insert them again at time 1. Or if the rrd 
definition allows, just insert at time 1 and let rrdtool fill in the 
same value at time 0.5.

The end effect is that the rrd database will hold the same 
rates/consolidated values from time 0 to 1 as it did before. But 
going forward, the new data will be processed at the higher 

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