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

