[collectd] eMail/Spamassasin plugins create 20% Wait-IO

Sebastian Harl sh<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>tokkee.org
Mon Apr 2 17:54:25 CEST 2007


Hi Stefan,

On Mon, Apr 02, 2007 at 05:18:53PM +0200, bd.trailing-username(a)leading-domain.bc-bd.org wrote:
> On Fri, Mar 30, 2007 at 09:41:59PM +0200, Florian Forster wrote:
> > On Mon, Mar 26, 2007 at 01:02:58PM +0200, bd.trailing-username(a)leading-domain.bc-bd.org wrote:
> > > after deactivating these plugins io dropped from 20% to almoust 0%.
> > 
> > I'm not very familiar with the email-plugin myself, but I don't see why
> > it generates so much Wait-IO from the code.. How many RRD-files do you
> > update with and without the plugin enabled?
> 
> As it seems a whole lot:
> 
> 	$ find -name "*.rrd" | wc -l
> 	277
> 	$ find email -name "*.rrd" | wc -l
> 	246

I haven't investigated this any further but I'm pretty sure this is the reason
for the high IO wait. AfaIk librrd does not do any caching and thus has to do
a lot of file operations...

> I took a quick look (5 minutes, as in: the following might be quite off)
> at the code and as it seems it reads data from the socket in one byte
> chunks (email.c, line 313):
> 
>         if (0 > (len = read (src->socket, (void *)&ret, 1))) {

No, data is read in chunks of up to 256 bytes. (See read_line(), ll. 337-409)

> I also dont't quite get the point why we use non blocking calls here,

Data should be processed in "real-time" as far as possible. I assumed that
read() blocks if not enough data is available. As we're using a socket, I
might be wrong though... However, it should not make a difference in that case
;-)

> and why the fd_sets for select() only contain one socket.

Ignorance and/or laziness, I guess... ;-)

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl
GnuPG-ID: 0x8501C7FC
http://tokkee.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/20070402/2209219c/attachment.pgp


More information about the collectd mailing list