[rrd-users] rrdtool - features ... 2nd y-axis

Alex van den Bogaerdt alex at ergens.op.het.net
Sat May 31 14:06:02 CEST 2008

On Sat, May 31, 2008 at 01:11:40PM +0200, Karl Fischer wrote:

> Sometimes this can be solved by storing the same value as GAUGE and
> COUNTER - to be able to retrieve minimal changes on a big value ...

Both gauge and counter are not stored. These are, or result in, rates
before normalization.  Once they are normalized, the resulting rate
is stored. And that is still subject to consolidation.

If the rate ("the number") is very high and the difference between
extremities is very small (e.g. your petabyte + or - a few bytes)
then this is probably best solved by subtracting a petabyte, storing
the result, and stack the resulting rates on top of a petabyte constant.

In theory such an offset could be programmed into RRDtool but I think
it is not worth the effort. 

A new feature means more resources used, and more chance for Mr.Murphy.
Every user has these problems, and no one but one or two have the

Such a special case (who's dealing with petabytes plus or minus 1 byte?)
is best handled in a customized front end.  My 2ct, of course.

> It even goes further in terms of (disk) space used when you think in
> the other direction:
> Sometimes you need to record small ints only (e.g. because the value
> never exceeds a range from 0 .. 100) - but storing doubles takes eight
> times the space ...

On the other hand, having multiple choices in the code, at various
places in the code, will have a negative impact on CPU utilization
and processing time.

For example (and yes, this is a simplified example):

a:  read 400 rates -> read 8*400 bytes
    show 400 doubles -> 400 times FP computation to get y-axis value

b:  read 400 rates ->
      if datatype==nibble
      then read 400/2 bytes
      else if datatype=byte
      then  read 400 bytes
      else if datatype==longint
      then read 4*400 bytes
      else if datatype==double
      then read 8*400 bytes
      else read 16*400 bytes
    show 400 doubles ->
      if datatype==nibble 400 times find proper halfbyte and do int computation
      else if (datatype==byte) or (datatype==longint) 400 times int computation
      else 400 times FP computation

Yes, you save a few disk blocks... but I think I still prefer (a) over (b).

Alex van den Bogaerdt

More information about the rrd-users mailing list