[collectd] [PATCH] Collection3: ~24x improvement to graph rendering speed on large systems
dwm at doc.ic.ac.uk
Mon May 16 13:21:35 CEST 2011
Attached is a patch to the CollectD::Graph::Common library used by graph.cgi,
part of the Collection3 perl scripts shipped with CollectD under contrib/.
At present graph.cgi extremely slowly on servers with large numbers of RRD
files. This is because it issues an unnecessary stat() call to _every_ RRD
file on the local system before loading and rendering graph data.
I've chased this behaviour down to the function get_files_by_ident() in
CollectD::Graph::Common -- which even has some faster, more specific code
commented out that doesn't work -- presumably because the internal
data-structures it used evolved in an incompatible way.
I've uncommented it out, and applied a trivial fixup so that it matches the
internal data-structures used internally.
On my system, which has on the order of 100,000 individual RRD files, this
patch speeds graph rendering (in the hot-cache case) from 6s to just ~0.25s, a
David McBride <dwm at doc.ic.ac.uk>
Department of Computing, Imperial College, London
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 582 bytes
Desc: not available
More information about the collectd