[rrd-users] rrdgraph never returns with small step

Josh Wyatt josh.wyatt at hcssystems.com
Thu Jun 19 04:10:21 CEST 2008


Hi all,

I've been using RRDTool for quite awhile for other projects, and when it came time to build a datalogger for the ADC I'm using to measure parameters for my electric vehicle controller development, it seemed the natural choice, but I'm having some trouble.

I'm using Perl 5.8.6 on Gentoo Linux.  I started with 1.2.27 (latest ebuild) but in order to further troubleshoot I decided to build and upgrade to 1.3.0.  

For my controller monitoring, I am using an ADC with 11 input channels, and I hope to update the RRD every second, and keep a day's worth of data.  In other words 11 DS values, with a step of 1 (heartbeat of 5), and a single RRA with PDP=1 and 86,400 rows.  The ADC is a 10-bit ADC, so min=0 and max=1024.  I can create the RRD, update it ever second nicely, but when I try to graph more than say 30 seconds of data, rrdgraph hangs and does not return.

Here is my 'create' command:
/usr/local/bin/rrdtool create bits.rrd -s 1  \
DS:00:GAUGE:5:0:1024  \
DS:01:GAUGE:5:0:1024  \
DS:02:GAUGE:5:0:1024  \
DS:03:GAUGE:5:0:1024  \
DS:04:GAUGE:5:0:1024  \
DS:05:GAUGE:5:0:1024  \
DS:06:GAUGE:5:0:1024  \
DS:07:GAUGE:5:0:1024  \
DS:08:GAUGE:5:0:1024  \
DS:09:GAUGE:5:0:1024  \
DS:10:GAUGE:5:0:1024  \
RRA:AVERAGE:.5:1:86400

This works fine... It does make a big file though, about 7.3MB.

The update is via RRDs:
$e=RRDs::update('bits.rrd','-t','00:01:02:03:04:05:06:07:08:09:10',"N$total");
The way $total is built, it includes a preceding ':' so that a typical line looks like this:
$e=RRDs::update('bits.rrd','-t','00:01:02:03:04:05:06:07:08:09:10',"N:35:11:13:12:12:14:10:10:604:591:11");

And this updates the RRD every second, in a loop.

Now, I try to graph:
/usr/local/bin/rrdtool graph /home/graphs/all.png  -s -30s -w 200 -h 40 -a PNG
 -A  \
DEF:00=/home/graphs/bits.rrd:00:AVERAGE \
LINE1:00#00cccc  

And very often, this command will just hang, consuming lots of CPU.
It's worth noting at this point that with 1.2.27, it also seemed to also consume more and more memory, until the machine started swapping... With 1.3.0 this does not seem to be the case, it limits itself to maybe 8-10MB virtual, and just chews CPU.  The memory consumed varies with graph size.  I have tried 200x40, 800x400, several other graph sizes, and no love...

Now, sometimes it will build the graph if I specify '-s-40s' or less.  It doesn't always hang with that time spec.  However, I can always get it to hang with 60 seconds back or more.

Any thoughts or hints?

Thanks in advance,
Josh



More information about the rrd-users mailing list