[rrd-users] Usual RRD question on AVERGAE, MAX and consolidation :)

James Bensley jwbensley at gmail.com
Mon Dec 30 18:04:57 CET 2013


Hi All,

Many thanks for your input. I have been thinking it over trying to
work out what is the best scenario for me, but despite everyones
helpful feedback, this has confused me somewhat :)

We are billing based upon 95th percentile which is pretty common. If I
generate a graph on the CLI using RRDTools it looks like this;
http://i.imgur.com/riEMSPV.png

The 95th percentile value is actually calculated by a PHP script and
passes it as a COMMENT and HRULE to RRDTools which then generates the
graph linked above. I have an accurate 95th percentile value, the PHP
script dumps all 5 minute values for a month and calculates it by hand
(using DEF:ds0=my.rrd:ds0:MAX, and since I am dumping the whole month
and the RRAs keep all samples for two years, this is fine, and the
same as if I was using DEF:ds0=my.rrd:ds0:AVERAGE).

If I compare the last 100 samples for example, from both AVERAGE and
MAX, they are all the same line for line (although I am just showing
10 below to reduce the size of this email):

james.bensley at d:/$ sudo /usr/bin/rrdtool fetch --start=1383264000
--end=1385855700 /var/lib/cacti/rra/router1_traffic_in_15176.rrd
AVERAGE | tail -n 10
1385853300: 4.9921194667e+03 1.8153038000e+03
1385853600: 6.1680891000e+04 2.7375534667e+03
1385853900: 6.0396357933e+04 3.1846755333e+03
1385854200: 6.1290392667e+03 2.2950537333e+03
1385854500: 6.2416655467e+04 2.7198662000e+03
1385854800: 6.4314943667e+04 3.0344772667e+03
1385855100: 5.0561721333e+03 1.8135508000e+03
1385855400: 6.3321694000e+04 4.0585688667e+03
1385855700: 5.9577035933e+04 3.3799286000e+03
1385856000: 6.4475479035e+03 2.8579428004e+03

james.bensley at d:/$ sudo /usr/bin/rrdtool fetch --start=1383264000
--end=1385855700 /var/lib/cacti/rra/router1_traffic_in_15176.rrd MAX |
tail -n 10
1385853300: 4.9921194667e+03 1.8153038000e+03
1385853600: 6.1680891000e+04 2.7375534667e+03
1385853900: 6.0396357933e+04 3.1846755333e+03
1385854200: 6.1290392667e+03 2.2950537333e+03
1385854500: 6.2416655467e+04 2.7198662000e+03
1385854800: 6.4314943667e+04 3.0344772667e+03
1385855100: 5.0561721333e+03 1.8135508000e+03
1385855400: 6.3321694000e+04 4.0585688667e+03
1385855700: 5.9577035933e+04 3.3799286000e+03
1385856000: 6.4475479035e+03 2.8579428004e+03


My issue is this though:

Using AVERAGE produces lower values on a graph for
current/average/max/total statistics at the bottom of the graph, and
the graph is drawn differently showing this. This is the same DS as
above but using AVERAGE instead of MAX, you will notice the 95th
percentile value is the same becasue it is generate by the external
PHP script as I mentioned: http://i.imgur.com/P27kjfc.png

Since the 95th percentile is accurate there will be no billing
problems. However the graphs may be misleading for customers trying to
see peaks in their usage. I understand now this is becasue of
consolidation when drawing the graphs, having to fit more data points
into the graph than there are pixels to display the data. I don't want
to draw huge graphs as we have mentioned :) So I can either draw the
graphs using AVERAGE however this will presumably show less usage then
they are actually using, and MAX will probably show higher, so is
there any other option for me, or do I need to draw massive graphs? :)


Many thanks,
James.



More information about the rrd-users mailing list