OK, I've also had some other discussions. Looks like there is no quicker way to do it. So I think I'll ditch the approach to have a generic capability to do timeout processing and rather do specific code for each use case. As you write, this is no problem for the file writer. I'll probably go to write every 10 seconds or so (if there is a buffer flush request pending). I'll evaluate the other use cases when I come along them.
Thanks everyone for commenting :) Rainer > -----Original Message----- > From: [email protected] [mailto:rsyslog- > [email protected]] On Behalf Of Aaron Wiebe > Sent: Monday, June 15, 2009 5:58 PM > To: rsyslog-users > Subject: Re: [rsyslog] high-performance, low-precision time API under linux? > > On Mon, Jun 15, 2009 at 11:45 AM, Rainer > Gerhards<[email protected]> wrote: > > > > It's not about a few dozen times. I need to re-set the timer when I > logically > > write something to the file. The problem is that I don't know how long it > was > > since I did this the last time. So I would end up with calling time once per > > logical write, that is a in the range of tenthousand to hunderedthousand > > times per second. > > I'll suggest this first, since it has the possibility of being the > best solution: posix aio. Have a look at `man 3 aio_write'. That > should reduce your write() latency enough to not worry about IO > blocking and messing with the clock reasonably well. I've used this > method in the past, and it generally works wonders - plus its not too > hard to implement. The downsize is that it isn't very portable. > > Otherwise, you're looking at batched writes and timer resets after the > batch completes. There is nothing required in terms of delivering > messages to a file within a few seconds, so you could batch up writes > up to a high watermark / specified time prior to starting a write > cycle. > > -Aaron > _______________________________________________ > rsyslog mailing list > http://lists.adiscon.net/mailman/listinfo/rsyslog > http://www.rsyslog.com _______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com

