-1

I create a RRD with one DS, the processing time of a script, with 10 minutes step. Having three archives, with MAX as aggregation function : all values over a week, every hour over a month, every day over two years.

rrdtool create RRD --start 1411561343 --step 600s \
DS:processtime:GAUGE:1200:0:U \
RRA:MAX:0.5:1:1008 \
RRA:MAX:0.5:6:744 \
RRA:MAX:0.5:144:732

I populate it from a file which contains all records from the 2014/09/24 at 14:32:23 (1411561943) to the 2016/01/11 at 11:07:25 (1452503245). The maximum is for the 2015/09/11 at 14:18:35 (1441973915), 23340.

When I graph or dump the rrd, I have a lot of NaN, I don't see this maximum, neither many other significant values. The max I have in the rrd is <!-- 2015-08-06 02:00:00 CEST / 1438819200 --> <row><v>8.0004250000e+02</v></row>.

Is it related to the fact that intervals are not exactly 10 minutes but between 8 and 12 ?

If so, it there a way to change this behavior ?

Setop
  • 2,262
  • 13
  • 28

2 Answers2

0

First rrdtool resamples the data to the given interval in in --step only then will the data be further processed. The intervals are aligned to epoch timestamps (starting 1970-01-01 00:00:00 GMT). If you want to have a maximum for a shorter interval, you have to lower the step and feed data more frequently.

Tobi Oetiker
  • 5,167
  • 2
  • 17
  • 23
0

As Tobi reminds you, your samples will first be normalised/resampled into regular 10min intervals, regardless of when they arrived. You cannot disable this behaviour except by inserting the data exactly on the time interval boundaries.

Your MAX values may not be for the intervals that you seem to think they are.

RRA:MAX:0.5:1:1008 \
RRA:MAX:0.5:6:744 \
RRA:MAX:0.5:144:732

Your RRA are for 1, 6 and 144 samples. Since your interval is 10min, these RRA correspond to 10min, 1hour, and 1day respectively, and will hold the maximum valued normalised sample within that interval.

Also, you have an XFF of 0.5, meaning that more than 50% of the required samples must be present for the RRA to store a value, and a heartbeat on your DS of 20min, meaning a sample is unknown if there is a gap of that long.

You might like to add a RRA:AVG:0.5:1:1008 for reference so that you can verify what data you are collecting and track down the source of the NaN.

Note that, when graphing or using xport, rrdtool will calculate a Max on the fly from available data if an appropriate RRA covering the entire requested time window is not available.

You can verify the MAX calculation by using an AVG RRA as above, and fetching this pre-aggregate data to compare with the values stored in your MAX RRA.

Steve Shipway
  • 3,754
  • 3
  • 22
  • 39