[rrd-users] Re: choosing an RRA for graph generation

Alex van den Bogaerdt alex at ergens.op.het.net
Sat Dec 14 13:32:03 MET 2002

On Fri, Dec 13, 2002 at 04:14:32PM -0500, Chris Robb wrote:

> I upsized the RRD files about two weeks ago. This inserts empty 5 minute
> data for the prior 2 years. When RRD chooses the RRA to look at when doing
> a yearly graph, it appears to be looking at the 5 minute data, solely, and
> not the daily averages. This makes it look like there's no data collected
> before the day I upsized, which isn't true.

Oh yes it is true.  Well, it is *unknown* data.

*You* ask for data that isn't there yet.  RRDtool does NOT know what
the rates were say 1 year ago.  It does know what the average rate was
in a 1-day resolution but *you* ask for daily averages.

How do you do that?  RRDtool tries to do a >>>best match<<<.

In case you query the database at 00:00 UTC (!) exactly (!) and ask
for a time period that exactly (!) matches the number of pixels in
your graph, RRDtool *will* use the "yearly" RRA.

- Determine which RRA you want to use
- Detemine the number of seconds per CDP in this RRA (the "yearly" RRA
  will have 86400 seconds, the "weekly" will have 1800 per CDP). Let's
  call this number "t".
- Determine how much of those CDPs you want to show.  For instance,
  400 would be a nice number.  You'd be displaying 400 days, or 400
  half hours.  Let's call this number "w".
- Set "--width" to "w"  ("--width 400").
- Set "--start" to "end" - w * t (so: 400*86400: "--start end-34560000")
- Determine the current time in seconds since the epoch, then find the
  nearest time which is stored in the RRA.  For instance:
    current time:              1039868723
    integer divide by 86400:        12035
    multiply by 86400:         1039824000
  (yes: this is "now - (now modulo 86400)"
- Use this time for "--end":  "--end 1039824000"

Now RRDtool tries to find a best match for
"--end 1039824000 --start 1005264000 --width 400"
and it will find an exact match for it in the available RRAs.

You are asking for "--end now --start end-1y" (or similar) and
RRDtool will search for "--end 1039868723".  The nearest available
row in a CDP is at (now - (now modulo 300)) which is best matched
by the "daily" RRA.

Much of what looks like rudeness in hacker circles is not intended to give
offence. Rather, it's the product of the direct, cut-through-the-bullshit
communications style that is natural to people who are more concerned about
solving problems than making others feel warm and fuzzy.


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
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list