[rrd-users] Using PRINT to output a MAX value for very short period

Michael Crews Michael.Crews at ticketmaster.com
Wed Apr 3 19:12:34 CEST 2013


I've created rrds to store session counts collected (using another tool) from our load-balancing VIPs.  New data is available every 30 seconds, so I set the step size to 30 seconds.  I created 5 RRAs to keep track of the MAX sessions over different intervals. The CF for all of them is MAX.  

1 PDP over 2880 rows = 1 day of 30 second data 
2 PDP over 1440 rows = 1 day of 1 min data 
20 PDP over 1008 rows = 1 week of 10 min data 
120 PDP over 720 rows = 1 month of 1 hour data 
2880 PDP over 366 rows for a year of daily data. 

The problem occurs when I want to query the rrd for the smallest intervals.  I use RRDs to do this from perl.

my ($data,$x,$y) = RRDs::graph ( 
        /dev/null, 
        "DEF:cluster=cluster.rrd:sessions:MAX:step=30:start=end-1min:end=now-1hour",
        "VDEF:sessions=cluster,MAXIMUM", 
        "PRINT:sessions:%.lf" ); 

This outputs NaN into $data, until I increase the interval between start and end to at least 4 minutes.  step=30:start=end-4min:end=now-1hour works as expected.  step=30:start=end-3min:end=now-1hour prints NaN.

If I increase step to more than about 330, I can get data for the shortest intervals, even down to 30 seconds between start and end.   Using rrdtool fetch, I find that steps (-r) smaller than about 330 will produce 2 or 3 lines of data when queried for a 1 minute interval, but if the step (-r) is 330 or larger, I get one line of data.  The MAX CF ought to produce one number for whatever interval, shouldn't it?

Sometimes with step=300 or 320 and 1 minute between start and end, I get an error like this:

SANITY CHECK: 18446744073709551611 rows cannot be reduced by 5 
BUG in reduce_data() 

I feel like I am misunderstanding something basic here.  Can anyone explain what I am seeing?

RRDtool 1.4.7 

rrdtool info: 
filename = "/uv/local/uv/new/queue/tmol/us/phx2.rrd" 
rrd_version = "0003" 
step = 30 
last_update = 1364848568 
header_size = 1416 
ds[sessions].index = 0 
ds[sessions].type = "GAUGE" 
ds[sessions].minimal_heartbeat = 60 
ds[sessions].min = 0.0000000000e+00 
ds[sessions].max = 2.5483000000e+04 
ds[sessions].last_ds = "5845" 
ds[sessions].value = 4.7735390220e+04 
ds[sessions].unknown_sec = 0 
rra[0].cf = "MAX" 
rra[0].rows = 2880 
rra[0].cur_row = 924 
rra[0].pdp_per_row = 1 
rra[0].xff = 5.0000000000e-01 
rra[0].cdp_prep[0].value = NaN 
rra[0].cdp_prep[0].unknown_datapoints = 0 
rra[1].cf = "MAX" 
rra[1].rows = 1440 
rra[1].cur_row = 478 
rra[1].pdp_per_row = 2 
rra[1].xff = 5.0000000000e-01 
rra[1].cdp_prep[0].value = -inf 
rra[1].cdp_prep[0].unknown_datapoints = 0 
rra[2].cf = "MAX" 
rra[2].rows = 1008 
rra[2].cur_row = 370 
rra[2].pdp_per_row = 20 
rra[2].xff = 5.0000000000e-01 
rra[2].cdp_prep[0].value = 5.9896495703e+03 
rra[2].cdp_prep[0].unknown_datapoints = 0 
rra[3].cf = "MAX" 
rra[3].rows = 720 
rra[3].cur_row = 263 
rra[3].pdp_per_row = 120 
rra[3].xff = 5.0000000000e-01 
rra[3].cdp_prep[0].value = 6.2177897131e+03 
rra[3].cdp_prep[0].unknown_datapoints = 4 
rra[4].cf = "MAX" 
rra[4].rows = 366 
rra[4].cur_row = 238 
rra[4].pdp_per_row = 2880 
rra[4].xff = 5.0000000000e-01 
rra[4].cdp_prep[0].value = 6.2177897131e+03 
rra[4].cdp_prep[0].unknown_datapoints = 2355 



More information about the rrd-users mailing list