[rrd-users] Graphing inconsistencies graphing different time slices

Simon Hobson linux at thehobsons.co.uk
Mon Jun 8 16:01:16 CEST 2015


I wrote:

> So when you draw a graph over a longer time period, depending on the consolidation, you may see your maximum value go up (with these made up figures, by 1/3) when you add max values together.


To add ...

I had something similar for some of my servers - I wanted a maximum mail queue size across several servers. Simply adding the max queue sizes doesn't work for the reasons I gave before, eg if 3 servers all have a queue size of 1 but at different times, the maximum cumulative queue size is 1, not 3.
I wrote a script* that would periodically query the stats for each server, get the latest figures, add them, and put them into another RRD file for the totals. So as well as RRD files for each server, I have one for the combined values. As long as the script keeps the combined file up to date enough, it can use unconsolidated values from the individual servers.

This combined RRD can then be consolidated and return the correct max values.

* Which turns out to be more complicated than you might think !
It needs to find out the last complete "bucket" of data for each of the source files and see if the oldest of these is newer than that for the combined file - and if so, then update the combined file. You need to allow for delayed data from one or more servers (I'm using RRD cached which can delay updates unless you keep flushing it which defeats the object of the cacheing).
But then, you need to allow for one (or more) servers being offline (as far as stats collection goes), so you need to decide how long to wait before taking an individual value as NaN.



More information about the rrd-users mailing list