[collectd] [PATCH] Random write timeout for rrdtool plugin

Sebastian Harl sh at tokkee.org
Tue Aug 18 15:01:03 CEST 2009


Hi Mariusz,

On Tue, Aug 18, 2009 at 01:08:30PM +0200, Mariusz Gronczewski wrote:
> > That's true. However, (unless I'm missing something, didn't have a
> > coffee yet ;-)) that should only make a difference during start-up -
> > after some iterations both approaches should behave quite similar,
> > right?
> Nope. Because with your approach it works like that
> 1.Start
> 2.Pull all (last_value-first_value) >CacheTimeout and push it into write queue
> 3.At that point last_value=first_value for all cached entries
> 3.write it at calculated rate to disk
> So even tho u save them at different time with predefined writes/s, u
> pull all values from cache at same time so their timeout is
> "synchronized" with eachother (and still last value will get written
> in 2*cache timeout). But idea of autotuning writes per sec is nice ;]

Well, I did not have any implementation details in mind. In fact, I did
not even look at the 'WritesPerSecond' implementation until right now
;-)

> But when u add random number to Cache Timeout, some of values get
> pulled bit earlier, some of them will get pulled a bit later and after
> few cycles it will spread nicely.
> 
> For your approach to work you would have to pull values from cache and
> push it to write queue at calculated rate, not push all values to
> write queue at once and dequeue it at calculated rate.

Hrm, in fact, I don't think that makes a difference at all. Putting a
value into the write (or flush) queue does not mean it is removed from
the cache. Rather, basically, a pointer to the cache entry is stored in
the queue. (Well, you'd save the memory to store the pointers to the
cache entries ...) So, while the implementation differs, the behavior
should be about the same. Am I missing any details you had in mind?

Anyway, I don't see a _real_ disadvantage of your approach either. _I_
would have used a more "deterministic" approach and I wanted to share my
two cents about that ;-) I do not oppose to integrate your patch.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090818/d7321d0a/attachment.pgp 


More information about the collectd mailing list