[rrd-users] Monitor Xen VPS network usage using rrdtool

David Nolan vitroth at gmail.com
Thu Oct 30 14:41:33 CET 2008


On Thu, Oct 30, 2008 at 9:28 AM, Nuno Pereira
<nunopereira at interacesso.pt> wrote:

> I supose that you are using counters for storing bandwidth, reading the
> current values.
> In that case, when the counter goes 0, after rebooting or resetting the
> values, the RRD thinks that the counter wrapped (passed the estimated
> (2^32)-1  value of maximum for the counter) and uses the value 2^32 - 1 +
> new_value - old_value for estimating the counter difference (instead of the
> real difference), dividing it by the time between retrievals.
>
> The best thing to do is to set a maximum value for the bandwidth.
> In that case, when the system reboots the value doesn't go that high.
>


My preferred solution to this is to use DERIVE instead of COUNTER,
with a minimum value of zero.  For counters that never go backward
this results in a single datapoint being thrown away anytime the
counter is reset.   (Due to wrapping, power cycling, process restart,
"clear counters" on a router, etc...)

Functionally this is basically equivalent to setting a max and
throwing away the data point when the value is too high.  But you
don't have to calculate what max value you should use, and there are
no edge cases where the last value was less then the max from the
rollover value and a reset generates a counter difference of less then
the max but still horribly inaccurate.

-David



More information about the rrd-users mailing list