[rrd-users] rrdtool multi DS heartbeat problem

Mike Schilli m at perlmeister.com
Sun Apr 26 20:19:31 CEST 2009


With multiple data sources, there seems to be a bug with rrdtool,
causing it to ignore the heartbeat settings.

Here's a test case that reproduces the problem: We define a rrd with two
data sources, each with a generous heartbeat of 57600:

   rrdtool 'create' 'myrrdfile.rrd' '--start' '1240729199' \
   '--step' '3600' 'DS:d2:GAUGE:57600:U:U' \
   'DS:d1:GAUGE:57600:U:U' 'RRA:MAX:0.5:1:100'

Then we feed in data, with separate calls for the data sources:

   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd1' '1240729200:100'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd2' '1240729201:100'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd1' '1240734300:97'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd1' '1240741440:95'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd1' '1240750740:88'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd1' '1240756500:86'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd2' '1240767900:83'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd2' '1240777140:80'

Now, if you print the graph of d2, you'll notice a gap:

   rrdtool 'graph' 'mygraph.png' '--vertical-label' \
   'Graph Bug' '--end' '1240868880' '--start' '1240729200' \
   'DEF:draw2=myrrdfile.rrd:d2:MAX' 'LINE1:draw2#0000FF:d2'

Note that the data rate of d2 is compliant with the heartbeat at all
times, but yet, rrdtool seems to miss out on some PDPs.

However, if you leave d1 out of the test, hence running

   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd2' '1240729201:100'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd2' '1240767900:83'
   rrdtool 'update' 'myrrdfile.rrd' '--template' 'd2' '1240777140:80'

after creating the rrd, everything is okay and there's no gap in the
graph:

   rrdtool 'graph' 'mygraph.png' '--vertical-label' \
   'Graph Bug' '--end' '1240868880' '--start' '1240729200' \
   'DEF:draw2=myrrdfile.rrd:d2:MAX' 'LINE1:draw2#0000FF:d2'

Could it be that rrdtool's heartbeat logic gets confused with multiple
data sources?

-- Mike

Mike Schilli
m at perlmeister.com



More information about the rrd-users mailing list