Impact of having a large number of open file descriptors
Ivan Voras
ivoras at freebsd.org
Wed May 28 16:26:06 UTC 2008
2008/5/28 Oliver Fromme <olli at lurza.secnetix.de>:
> Ivan Voras wrote:
> > Im thinking again of the old idea of implementing poor man's file
> > replication system using kqueue to monitor changes on files.
>
> It would be cool to have a kernel interface so you could
> attach to a mountpoint and receive a log of all activity
> on that file system. That's similar to what DragonFly's
> journaling feature does.
/me agrees.
> Unfortunately the kqueue interface isn't capable of doing
> something like that ... So this is not an answer to your
> question, I'm afraid.
>
> > One other question: do kqueue events "coalesce" in the sense that if N
> > operations happen (like write()s), there can be < N events passed to the
> > kqueue (NOTE_WRITE)?
>
> The manpage says: "Multiple events which trigger the filter
> do not result in multiple kevents being placed on the kqueue;
> instead, the filter will aggregate the events into a single
> struct kevent."
That's mildly unfortunate but I think you're right - it agrees with
the statement from the kqueue paper: "Events will normally considered
to be "level-triggered",
as opposed to "edge-triggered"."
> > While at it, will EVFILT_VNODE and NOTE_WRITE catch "additional" ways
> > the file can be modified, meaning mmap()?
>
> A quick grep for NOTE_WRITE on the sys tree indicates that
> it doesn't. I'm not 100% sure though.
Also bad for some users.
More information about the freebsd-hackers
mailing list