EVFILT_VNODE doesn't scale to large directory trees?

Igor V. Ruzanov igorr at canmos.ru
Mon Oct 25 08:54:48 UTC 2010


On Mon, 25 Oct 2010, Erik Trulsson wrote:

|On Mon, Oct 25, 2010 at 10:48:58AM +0400, Igor V. Ruzanov wrote:
|> On Sun, 24 Oct 2010, Kenton Varda wrote:
|> 
|> |That doesn't answer my question.  I'm not even using make.  I could write a
|> |few thousand words describing exactly what I'm trying to do and why it does,
|> |in fact, make sense, but it's really beside the point.  I just want to know
|> |if there is any scalable way to monitor a very large directory tree for
|> |changes.  Is there?
|> |
|> Dig `kqueue' - its the native FreeBSD's events polling/notification 
|> mechanism.
|
|Since the OP mentioned using EVFILT_VNODE I would assume he is already
|using kqueue but is not satisfied with it.
|
I thought so too but was not sure about his problem. With 
kqueue()/kevent() we can monitor every open file descriptor. So how many 
files are laid down in the directory tree, 100, 1000, 15000? In every 
such way its possible to write or find already written daemon that 
monitors every file in selected folder doing several jobs in separate 
threads. There is might be little problem with receiving of *lots* events, 
so we could create several pipes (for example) for setting up of 
communication between deamon and system.
Note that we must remember to set proper meaning of kern.maxfiles sysctl 
variable.

+-------------------------------------------+
! CANMOS ISP Network                        !
+-------------------------------------------+
! Best regards                              !
! Igor V. Ruzanov, network operational staff!
! e-Mail: igorr at canmos.ru                   !
+-------------------------------------------+


More information about the freebsd-questions mailing list