[collectd] [PATCH] - flush rrdtool cache to disk on SIGUSR1

Florian Forster octo at verplant.org
Tue Feb 26 10:35:44 CET 2008


Hi,

On Tue, Feb 26, 2008 at 12:49:34AM +0100, bd at bc-bd.org wrote:
> Extending the plugin api comes to my mind, eg
> 
> 	plugin_register_flush(...);
> 
> and catching USR1 in the main thread, then call _flush for all plugins.

I like this idea a lot. I've been thinking about how to have the network
plugin send data after each read: Right now the network plugin fills the
buffer as full as it gets before sending out a packet. This means, that
at the end of each ``turn'' some data may be left in the buffer. If you
have very few plugins loaded, say, only the interface plugin with only
one interface selected, the buffer fills very slowly and one package may
be sent every 6 intervals (or so).
This is not a problem per se, because the timestamp is included in the
data and the rrdtool and csv plugins use that time. The new monitoring
stuff may however note, that performance data is missing and call for
help.

A `flush' callback, together with a config option `FlushAfterRead', may
solve this problem.

> Or create a UNIX socket somewhere /tmp/collectd_flush which will
> trigger rrdtool.c to write its data but we would need another thread
> for that, though no signal handlers in the plugin.

I was more thinking along the lines of implementing a new command for
the unixsock plugin which will cause the flush, too.

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080226/9578a7fe/attachment.pgp 


More information about the collectd mailing list