[rrd-users] rrd daily, monthly, weekly, yearly...

Wernher Eksteen weksteen at gmail.com
Thu Nov 22 18:48:36 CET 2007


On 22/11/2007, Wernher Eksteen <weksteen at gmail.com> wrote:
> On 22/11/2007, Simon Hobson <linux at thehobsons.co.uk> wrote:
> > Wernher Eksteen wrote:
> >
> > >Currently I have graphs tracking byte/s over daily, monthly, weekly
> > >and yearly interval's, but not getting the results I need, my daily
> > >average seems to work fine at 5 minute interval's with a -step of 600,
> > >but my weekly, monthly and yearly graphs seems to be completely out of
> > >sync with values I'm getting compared to daily graphs.
> > >
> > >For instance, on daily graphs my MAX average of bytes/s outbound
> > >transfer rate was 8MB/s which is roughly 64Mb/s. Where as on my
> > >weekly, monthly and yearly graphs the MAX ave was only 3MB/s... Am I
> > >doing something wrong, or is that right?
> >
> > You seem to be making a common mistake.
> >
> > If you want MAX you must store MAX !
> >
> > If you store AVERAGE and then graph the max value of it, then you
> > will see lower figures.
> >
> > Suppose I download at 24mbps for one hour in a day. On a 10 minute
> > step size you will see a block at 24mbps. If you let that feed
> > through into an RRA that creates an average over 24 hours then the
> > average for that day will be 1Mbps. Graphing MAX will only ever show
> > you that 1Mbps.
> >
> > If you want to be able to see the 24Mbps, then you need to create an
> > RAA with MAX function - graphing MAX will then use the MAX RRA and
> > you will see 24Mbps for that day.
> >
> >
> > So if you will need max in the future store max, if you will need
> > average then store average, if you will need min then store min - if
> > you need all three then you store all three (they are different, 24,
> > 1, 0 in the example I've just given).
>
> Hi, thanks for responding so soon!
>
> Ok so if I'm understandin you right, what you're saying is this...
>
> For AVERAGE this rrd is fine:
>
>  rrdtool create "${1}" \
>        DS:in:DERIVE:600:0:12500000 \
>        DS:out:DERIVE:600:0:12500000 \
>        RRA:AVERAGE:0.5:1:576 \
>        RRA:AVERAGE:0.5:6:672 \
>        RRA:AVERAGE:0.5:24:732 \
>        RRA:AVERAGE:0.5:144:1460
>
> For MAX I need to change it to:
>
> rrdtool create "${1}" \
>        DS:in:DERIVE:600:0:12500000 \
>        DS:out:DERIVE:600:0:12500000 \
>        RRA:MAX:0.5:1:576 \
>        RRA:MAX:0.5:6:672 \
>        RRA:MAX:0.5:24:732 \
>        RRA:MAX:0.5:144:1460
>
> For MIN I need to change it to:
>
> rrdtool create "${1}" \
>        DS:in:DERIVE:600:0:12500000 \
>        DS:out:DERIVE:600:0:12500000 \
>        RRA:MIN:0.5:1:576 \
>        RRA:MIN:0.5:6:672 \
>        RRA:MIN:0.5:24:732 \
>        RRA:MIN:0.5:144:1460
>
> And to have them all (MIN,  MAX and AVERAGE) can I do this?
>
> rrdtool create "${1}" \
>        DS:in:DERIVE:600:0:12500000 \
>        DS:out:DERIVE:600:0:12500000 \
>        RRA:MIN:0.5:1:576 \
>        RRA:MAX:0.5:1:576 \
>        RRA:AVERAGE:0.5:1:576 \
>        RRA:MIN:0.5:6:672 \
>        RRA:MAX:0.5:6:672 \
>        RRA:AVERAGE:0.5:6:672 \
>        RRA:MIN:0.5:24:732 \
>        RRA:MAX:0.5:24:732 \
>        RRA:AVERAGE:0.5:24:732 \
>        RRA:MIN:0.5:144:1460
>        RRA:MAX:0.5:144:1460
>        RRA:AVERAGE:0.5:144:1460
>
> And then at graph creation time can I do this?
>
>   rrdtool graph "${1}.new" -a PNG -s -"${2}" -w 550 -h 240 -v "bytes/s" \
>  'DEF:ds1='${3}':in:MIN' \
>  'DEF:ds2='${3}':out:MIN' \
>  'DEF:ds3='${3}':in:MAX \
>  'DEF:ds4='${3}':out:MAX' \
>  'DEF:ds3='${3}':in:AVERAGE' \
>  'DEF:ds4='${3}':out:AVERAGE' \
>  'LINE1:ds1#00FF00:Incoming Traffic' \
>  GPRINT:ds1:MAX:"Max %6.2lf %s" \
>  GPRINT:ds1:MIN:"Min %6.2lf %s" \
>  GPRINT:ds1:AVERAGE:"Avg %6.2lf %s" \
>  GPRINT:ds1:LAST:"Curr %6.2lf %s\n" \
>  'LINE1:ds2#0000FF:Outgoing Traffic' \
>  GPRINT:ds2:MAX:"Max %6.2lf %s" \
>  GPRINT:ds2:MIN:"Min %6.2lf %s" \
>  GPRINT:ds2:AVERAGE:"Avg %6.2lf %s" \
>  GPRINT:ds2:LAST:"Curr %6.2lf %s" \
>  -t "${4}"
>  mv -f "${1}.new" "${1}"
>
> Will this do the trick ?
>
> Thanks!
> Wernher
>

Sorry, correction about graph creation time...

And then at graph creation time can I do this?

 rrdtool graph "${1}.new" -a PNG -s -"${2}" -w 550 -h 240 -v "bytes/s" \
 'DEF:ds1='${3}':in:MIN' \
 'DEF:ds2='${3}':out:MIN' \
 'DEF:ds3='${3}':in:MAX \
 'DEF:ds4='${3}':out:MAX' \
 'DEF:ds5='${3}':in:AVERAGE' \
 'DEF:ds6='${3}':out:AVERAGE' \
 'LINE1:ds1#00FF00:MIN Incoming Traffic' \
 GPRINT:ds1:MAX:"Max %6.2lf %s" \
 GPRINT:ds1:MIN:"Min %6.2lf %s" \
 GPRINT:ds1:AVERAGE:"Avg %6.2lf %s" \
 GPRINT:ds1:LAST:"Curr %6.2lf %s\n" \
 'LINE1:ds2#0000FF:MIN Outgoing Traffic' \
 GPRINT:ds2:MAX:"Max %6.2lf %s" \
 GPRINT:ds2:MIN:"Min %6.2lf %s" \
 GPRINT:ds2:AVERAGE:"Avg %6.2lf %s" \
 GPRINT:ds2:LAST:"Curr %6.2lf %s" \
 'LINE2:ds3#00FF00:MAX Incoming Traffic' \
 GPRINT:ds3:MAX:"Max %6.2lf %s" \
 GPRINT:ds3:MIN:"Min %6.2lf %s" \
 GPRINT:ds3:AVERAGE:"Avg %6.2lf %s" \
 GPRINT:ds3:LAST:"Curr %6.2lf %s\n" \
 'LINE2:ds4#0000FF:MAX Outgoing Traffic' \
 GPRINT:ds4:MAX:"Max %6.2lf %s" \
 GPRINT:ds4:MIN:"Min %6.2lf %s" \
 GPRINT:ds4:AVERAGE:"Avg %6.2lf %s" \
 GPRINT:ds4:LAST:"Curr %6.2lf %s" \
 'LINE3:ds4#00FF00:AVERAGE Incoming Traffic' \
 GPRINT:ds5:MAX:"Max %6.2lf %s" \
 GPRINT:ds5:MIN:"Min %6.2lf %s" \
 GPRINT:ds5:AVERAGE:"Avg %6.2lf %s" \
 GPRINT:ds5:LAST:"Curr %6.2lf %s\n" \
 'LINE3:ds5#0000FF:AVERAGE Outgoing Traffic' \
 GPRINT:ds6:MAX:"Max %6.2lf %s" \
 GPRINT:ds6:MIN:"Min %6.2lf %s" \
 GPRINT:ds6:AVERAGE:"Avg %6.2lf %s" \
 GPRINT:ds6:LAST:"Curr %6.2lf %s" \
 -t "${4}"

Will this be correct to get the approriate values for daily, weekly,
monthly and yearly intervals with these steps below:

86400           =  1 day
604800          =  1 week
2678400        = 1 month
31536000      = 1 year



More information about the rrd-users mailing list