[rrd-users] RRD PERCENT question (95 percentile)

Andree Toonk andree.toonk at bc.net
Wed May 12 01:12:39 CEST 2010


Hello List,

I'm a happy RRD user, but there's something I need help with.
We're currently moving to RRDtool for accounting & billing.
For this I've created RRD files that keep 105120 5minute samples (1 year).

Now I'm comparing the 95% numbers generated by RRDtool with the 95% 
number generated by our old script. The problem is that these numbers 
are significantly different.

I hope someone can help me understand why these numbers are so different.

This is how I determine the 95 percentile number using RRDtool

/usr/local/rrdtool-1.2.19/bin/rrdtool graph /dev/null -f '' \
         --start '1271894400' --end '1272240000' \
          --width 700 --height 150 \
         DEF:"inoctets"="deviceid11_XXX_Transit.rrd":INOCTETS:AVERAGE \
         DEF:"outoctets"="deviceid11_XXX_Transit.rrd":OUTOCTETS:AVERAGE \
         CDEF:inbits=inoctets,8,* \
         CDEF:outbits=outoctets,8,* \
         VDEF:95thin=inbits,95,PERCENT \
         VDEF:95thout=outbits,95,PERCENT \
         PRINT:inbits:LAST:"CURRENTIN "%6.2lf%s \
         PRINT:inbits:AVERAGE:"AVERAGEIN "%6.2lf%s \
         PRINT:inbits:MAX:"MAXIN "%6.2lf%s \
         PRINT:95thin:"95IN "%6.2lf%s \
         PRINT:outbits:LAST:"CURRENTOUT "%6.2lf%s \
         PRINT:outbits:AVERAGE:"AVERAGEOUT "%6.2lf%s \
         PRINT:outbits:MAX:"MAXOUT "%6.2lf%s \
         PRINT:95thout:"95OUT "%6.2lf%s


My manual test was done like this:
1) fetch rawdata:
/usr/local/rrdtool-1.2.19/bin/rrdtool fetch \
	--start '1271894400' --end '1272240000' \
	"deviceid11_XXX_Transit.rrd" AVERAGE  > OUT_RAW;

2) read this data with a perl script than sort values and show 95% number.

In this case the data set contains 1153 samples (no NaN in sample).
so after sorting the 95% percentile should be the value (times 8 for 
bits) on position 1096.

The problem is that this number is quite different (lower) from what is 
returned using PERCENT above.
Note that this sample does not contain any NaN values.
I also tried this with the latest version of RRDtool, same result.

Can anyone explain why this is different? Is this expected?
How exactly does RRD this internally?

I would like to use RRDtool for this, but need to be sure that the 
numbers are correct, i.e understand why the numbers are different than 
when calculated manually.

I uploaded some more info, i.e perl script + RRD files here, for if you 
would like to verify:
http://www.toonk.nl/rrdtest/

Hope you can help me.

Thanks,
  Andree







More information about the rrd-users mailing list