[collectd] Completely wrong entry in rrddb

Florian Forster octo at verplant.org
Thu Mar 25 11:09:11 CET 2010


Hi Peter,

On Wed, Mar 24, 2010 at 07:26:37PM +0100, Peter Warasin wrote:
> From time to time i find completely wrong values within the rrd
> databases generated by the tail plugin. Something like:
> 8.5899345900e+08. Seems to be an overflow. In reality there should be
> not more than 2e-1-4e-1
> 
> I'm pretty sure that this happens when collectd will be restarted, (Or
> stopped?), since it happens quite regularly midnight, when a cronjob
> runs which restarts collectd.

this is due to a "counter reset". The "DERIVE" and "COUNTER" values are
converted to a rate using the following formula:

  rate = (new_value - old_value) / (new_time - old_time)

The two differ if "new_value" is smaller than "old_value":

  * When using a DERIVE data source, the rate simply is a negative
    value. If you set the "minimum" value to zero, negative values are
    regarded as being invalid by RRDtool and will be discarded.

  * When using a COUNTER data source, a special "wrap-around" handler is
    used. It assumes that the 32 bit or 64 bit boundary has been hit and
    takes this into account. The formula in this case becomes:

    if (old_value < 2^32)
      rate = (2^32 - old_value + new_value) / (new_time - old_time)
    else
      rate = (2^64 - old_value + new_value) / (new_time - old_time)

    In this case you need to set a reasonable "maximum" value in order
    to differentiate between a valid wrap-around and a counter reset.

There's also a wiki page describing the data source types in some
details, see [0].

HTH,
—octo

[0] <http://collectd.org/wiki/index.php/Data_source#Data_source_types>
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100325/d7e31090/attachment.pgp 


More information about the collectd mailing list