# [rrd-users] Re: stupid rra question

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Fri Mar 23 00:37:30 MET 2001

```Matt Ashfield wrote:

> If I wanted to store temperature data for say 2 years. Taking a temperature
> reading every half hour. I got to thinking, wouldn't I just need one RRA?

Yes, and no.  You probably want to see minimum, maximum and average
temperature.  When graphing the data in any resolution lower than
30 minutes per pixel, the consolidation functions will resample the
data and while the average temperature will be correct, the max and
min values won't be real if you only have one RRA with CF==AVERAGE.
For instance:
MAX(10,12,8,10) == 12
AVG(10,12,8,10) == 10
MIN(10,12,8,10) ==  8
After consolidating the data to 4 PDPs per pixel:
(10+12+8+10)/4 == 10 --> only one value
MAX(10) == 10
AVG(10) == 10
MIN(10) == 10

So, you probably need at least three RRAs:

After consolidating the data:
MAX(10+12+8+10) --> to MAX RRA
(10+12+8+10)/4  --> to AVG RRA
MIN(10+12+8+10) --> to MIN RRA

Back to the consolidation occuring.  If you can live with doing so
at graph time, there's nothing against that (AFAIK).  However, if
speed is of more importance than disk space, it is better to have
the data available at the correct resolution.

> RRA:AVERAGE:0.5:1:17520 where 17520 is the number of half-hours in a year?

366 days times 24 hours times 2 half-hours-per-hour == 17568.  Furthermore
you want two years of data so you need 17520+17568 == 35088 samples.
(365 days + 366 days; each day having 2*24 samples)

Cook book:

What do you want to show:
- Averages, maxima, minima: for each you need one RRA with that CF.
This is valid for both the graphing and for the (G)PRINTing of
the data.  You should not show MAX(averages), you should show
MAX(maxima) if you're interested in "real" maxima.
- Graphs always in the range from (now-x) to (now), or also high
resolution graphs from (now-x) to (now-y):
- now-x to now: you don't really need to keep the data at high
resolution for a long period of time.  If you will be graphing
at 400 pixels, you will display (for instance):
- 400 times half hour, total of 200 hours or 8d8h
- 400 times four hours, total of 1600 hours or 9w3d16h
- 400 times twelve hours, total of 4800 hours or 28w4h
- 400 times two days, total of 800 days
(don't use months, they don't have a fixed length)
For this example you need either 38400 samples at a half hour
resolution, or you need 4 different ranges:
- 400 samples at 1 PDP per CDP
- 400 samples at 8 PDPs per CDP
- 400 samples at 24 PDPs per CDP
- 400 samples at 96 PDPs per CDP
Much smaller database (less disk space) at the expense of less
accuracy further back in time.  This doesn't matter if you're
never going to show (1 year back - 200 hours) to (1 year back)
or similar. If you are:
- now-x to now-y: you need to determine in advance what will be
asked.  This is hard, very hard.  It is probably best to find
out if the data will be queried often and if so, invest in more
speed at the hardware level (if needed!) and just keep a large
amount of samples at a high resolution.  If the graphs won't be
queried that often in high resolution, you could perhaps keep
an online backup of the RRDs, for instance each month, and query
those archives at high resolution. I assume you can now determine
this all from the information you have.  If not, please say so.

cheers,
--
__________________________________________________________________
/ alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. |
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users