[rrd-users] newbie: can i do this with rrdtool?

Ivan Zahariev rrdtool at famzah.net
Mon Nov 16 11:01:39 CET 2009

I'm not really an expert on RRD but I don't think that this is doable
easily. RRD databases are fixed-column - which means that you cannot
measure/record data for an arbitrary count of different objects. You
either have to:
1) Monitor only a _known_ set of programs (for example, the programs
"firefox", "bash", "apache" and "mysql", nothing more, nothing less);
2) Create a separate RRD database for each program (on-the-fly as new
program names become available because new programs were started), and
then consolidate all these RRD databases (which would be more than 10)
into one RRD graphic which represents only the 10 most memory-intensive

You will probably go with option (2).

Choosing which RRD databases to display is somehow tricky, as a program
may use a lot of memory at some time, and almost no memory after a
minute for the next 30 minutes - is this program a "memory-hungry" one
and should be displayed on the graphic, or not? If you want to analyze
which program used how much memory at some time, you can use "rrdtool
dump" or "rrdtool fetch" to retrive this info.

If I were you, I would visualize all available RRD databases on the
graphic and will not create/update a RRD database for programs which use
less than XX MBytes memory at the time of our measurement. I would also
automatically delete RRD databases which were not updated in a given
time period (which means that their program consumed less than XX MBytes
memory for the time period in question).

You can review the man page of "rrdgraph_examples" on how to visualize
several RRD databases on one graphic. It is actually very easy - just
define several DEF and LINE arguments to "rrdgraph", for example:

rrdtool graph test.png \
  DEF:ds0=/home/rrdtool/data/PROGRAM_NAME0.rrd:ds0:AVERAGE \
  DEF:ds1=/home/rrdtool/data/PROGRAM_NAME1.rrd:ds1:AVERAGE \
  LINE1:ds0#0000FF:"PROGRAM_NAME0 memory usage" \
  LINE1:ds1#0000CC:"PROGRAM_NAME1 memory usage"

I regret my reply is more theoretical than practical but I hope this
could lead you more easily to the practical implementation.


p_j_r_m wrote:
> Hello
> I´d like to create graphs for the top ten memory consumer programs in my systems. Can you point me to an example where several values (one for each program using memory) are stored at the same time in the rrd database and then retrieved?
> Thank you!
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

More information about the rrd-users mailing list