graphrrdtoolrrd

RRD - How to bypass the limitation of MIN and MAX RRAs being NaN for non consolidated CDPs


Let's say I have a RRD with 3 data sources: rtt_min, rtt_avg and rtt_max storing data from network packet round trip time tests. Explanation of each DS is somewhat obvious:

These tree float values are stored in RRD file after each test (assume the frequency is the same as RRD step value). My goal is to graph the rtt_avg value and also rtt_min and rtt_max as a boundary values. There are two obvious scenarios:

  1. I can graph AVERAGE for each DS which would produce accurate results for RRAs where each row has one PDP (1CDP = 1PDP; latest data with no consolidation). But for old data, average values for rtt_min and rtt_max would not be what I want, as i need to graph minimum and maximum values for those two data sources and AVERAGE function is not the best one for it.

  2. I can graph rtt_min:MIN, rtt_avg:AVERAGE and rtt_max:MAX which would behave as i want for consolidated (old) data, graphing the minimum, average and maximum DS values for consolidated interval, but would provide low resolution data for latest data for rtt_min and rtt_max. This is because MIN and MAX CDPs are NaN in 1PDP RRAs. Only after consolidation these CDPs have a value, but using them gives lower resolution data as there are multiple PDPs for each CDP. And those two would look strange alongside the rtt_avg which is higher resolution.

I need the combination of both. Since MIN and MAX are NaN for 1PDP RRAs, is there an easy way to graph rtt_max:LAST for the period there are data in LAST, and for older data to use rtt_max:MAX? The only solution i can think of right now is to somehow calculate the time for which we have data in LAST and to graph MAX before that time and LAST after.


Solution

  • I can graph rtt_min:MIN, rtt_avg:AVERAGE and rtt_max:MAX which would behave as i want

    This is what you should do; use a different CF for the MIN and MAX types.

    but would provide low resolution data for latest data for rtt_min and rtt_max. This is because MIN and MAX CDPs are NaN in 1PDP RRAs.

    This should not be the case. For a 1PDP RRA, MIN and MAX should give the same result as AVERAGE. The only reason I can think that this may be happening is that you have misdefined your RRAs or DSs with incorrect xff or heartbeat.

    Without the definition of your RRD I cannot be certain but I would imagine this to be the case. In the past, I have used MAX and MIN on a 1pdp-RRA without issue.

    One potential problem is that sometimes the very last value in the RRA is unknown (NaN) because it is not set until that timeslot has completely passed and a new data sample received. In the past, I have retrieved the last update time for the RRD and used that as the graph base time rather than 'now' to avoid this. If your update frequency is relatively small then this should not be an issue.