advice for tailing a file

Daniel Carosone daniel.carosone at gmail.com
Mon Dec 14 23:35:08 CET 2015


Well, that's active enough that polling in a timer is likely to return some
results each time, with a little tuning of the timer interval.

The notify style methods come into their own when most polls come back
empty, and you end up burning cpu just polling empty.

The other trap to be wary of is if the file gets rolled by some other
utility. Watching a directory full of moving files is where inotify and
similar mechanisms really come into their own.

Finally, an aside: illumos has gained support for Linux compatible inotify
via the LX brand work. The module above works in a SmartOS LX zone. I've
yet to sort out packaging issues and confirm, but I suspect it will also
work in a native zone with a little convincing that it doesn't have to be
Linux.
On 15 Dec 2015 9:22 am, "Scott Wiersdorf" <scott at ipartner.net> wrote:

> On Tue, Dec 15, 2015 at 08:26:50AM +1100, Daniel Carosone wrote:
> > What platform? Linux::Inotify2 and related modules might be a useful
> > option, especially if the log file is not heavily active.
>
> Define "heavily active". On a lighter file I'm expecting at least 60
> lines (16k bytes) per second. I might expect an order of magnitude
> more than that on a heavier file.
>
> This module seems promising... but I was hoping for some kind of
> platform independent way to do this (it will eventually be deployed on
> Linux probably most of the time, but with a possibility of BSD, and my
> development is done on a Mac).
>
> Thank you for the response; I'll look at this approach more closely.
>
> Scott
> --
> Scott Wiersdorf
> scott at ipartner.net
>
> _______________________________________________
> anyevent mailing list
> anyevent at lists.schmorp.de
> http://lists.schmorp.de/mailman/listinfo/anyevent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20151215/2d82f6ef/attachment.html>


More information about the anyevent mailing list