[rrd-users] Using Granular RRA Automatically

Stephen R Guglielmo srguglielmo at gmail.com
Tue Jan 24 15:26:51 CET 2017


On Mon, Jan 23, 2017 at 6:06 PM, Simon Hobson <linux at thehobsons.co.uk> wrote:
> Stephen R Guglielmo <srguglielmo at gmail.com> wrote:
>
>> With the above database, I update it once a day with four data points.
>> I record MIN, MAX, AVERAGE, and LAST on a weekly basis for 10 years. I
>> also record MIN, MAX, AVERAGE, and LAST on a daily basis for 35 days.
>>
>> My question is: Since the RRAs are not named, if I create 1 month, 1
>> year, and 2 year graphs, will the 1 month graph automatically use the
>> more granular RRAs (the "daily" 35-day ones as opposed to the "weekly"
>> 10-year ones)?
>
> Yes, it'll automatically use the "best fitting" RRA - which in most cases will be the right thing. You can also specify the resolution in your graph command.
>
>
>> Here is an example `graph` command that I received from the RRD Wizard:
>>
>> rrdtool graph 'sites-1month.png' \
>> --title 'Sites, 1 Month' \
>> --vertical-label 'Number of Sites' \
>> --width '800' \
>> --height '300' \
>> --full-size-mode \
>> --start end-1m \
>> ...
>
>
> It is recommended to explicitly specify the end time, and to round it to an integer multiple of the RRA resolution. So, for an RRA with a resolution of 1 day (86400 seconds), specify the end time as an integer multiple of 86400.
> And specify the start time as end-(integer multiple of resolution), and ideally the multiple will be the number of pixels in the graph which avoids rescaling the data to fit.
>
> Longer explanation, RRD will use the RRA which best fits - specifically it'll pick the RRA(s) providing the most data within the specified timescale, and if more than one, the one with the highest resolution. So in your case, if you plot a graph over 36 days then the 1 day RRA won't fill it and it'll switch to a coarser RRA. for 35 days and below, it'll pick the 1 day RRA as having the higher resolution.
> But there are cases where a coarser resolution may provide more data - though I don't think they are very common.
>
> Consider if you aggregated at 2 day and 5 day resolution - contrived but illustrates the point. There will be times where the 5 day RRA covers a day later than the 2 day RRA (basically where it's a multiple of 5 days since unix epoch) - and so the "use the RRA with the most data in the desired period" method will switch to the 5 day RRA.
> For a case like this, you'd need to explicitly specify the RRA to be used, and your data would stop a day earlier while showing more detail.


Simon,

Thank you for the information. It's helpful. If I were to do something
like the following:

rrdtool create filename.rrd \
  --step '86400' \
  'DS:Sites:GAUGE:172800:0:U' \
  'DS:DeletedSites:GAUGE:172800:0:U' \
  'DS:OutdatedSites:GAUGE:172800:0:U' \
  'DS:Users:GAUGE:172800:0:U' \
  'RRA:LAST:0.3:1:3660'

This will basically keep every single value entered for 3660 days (~10
years), correct? It won't consolidate any values? I understand this
will have increased disk usage in the .rrd file, but are there any
other downsides to doing this?

Thank you!
Steve



More information about the rrd-users mailing list