[rrd-users] Re: C calls in rrdtool
Iain Buchanan
iain at pcorp.com.au
Tue Sep 10 03:48:29 MEST 2002
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
On Tue, 2002-09-10 at 11:03, Stanley Hopcroft wrote:
> Dear Sir,
>=20
> If you don't mind the unsolicited question,
>=20
> On Tue, Sep 10, 2002 at 10:57:22AM +0930, Iain Buchanan wrote:
>=20
> > Or you could open a 2 way pipe to rrd, and read and write to / from it
> > that way. I've used this method very successfully in perl, so I imagin=
e
> > it would work ok in C too.
>=20
> would you mind saying a few words why you would choose duplex pipes over=20
> using the Perl bindings to the shared library (RRDs::create RRDs::update=20
> etc) ?
I first tried system calls from perl, one for every update! But they
are very time consuming, especially since I wanted rrdtool for its
powerful graphing capabilities and not so much its storage. I already
had data stored in another database, and so when I added it to rrdtool,
I was doing nearly 10^6 updates at once. Calling system this many times
is _very_ slow. So then I lumped some of the updates together into one
system call, but it was still a little too slow. I then came across
this near the top of rrdtool manual:
"FUNCTIONS
"While the man pages talk of command line switches you have to set in
order to make rrdtool work it is important to note that the rrdtool can
be 'remote controlled' through a set of pipes. This saves a considerable
amount of startup time when you plan to make rrdtool do a lot of things
quickly..."
Since it took a relatively short amount of time to alter my program to
use pipes, and since it was successful, I didn't see the need to spend
time and effort on other methods.
So it was the order in which I read manuals. Had I read about Perl
bindings earlier, I may have tried them first!
Regards,
Iain Buchanan
-- Attached file removed by Listar and put at URL below --
-- Type: application/pgp-signature
-- Desc: This is a digitally signed message part
-- Size: 232 bytes
-- URL : http://www.ee.ethz.ch/~slist/pantomime/12-signature.asc
-- Attached file removed by Listar and put at URL below --
-- Type: application/pgp-signature
-- Desc: This is a digitally signed message part
-- Size: 233 bytes
-- URL : http://www.ee.ethz.ch/~slist/pantomime/13-signature.asc
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list