From owner-freebsd-questions@FreeBSD.ORG Mon Oct 25 08:54:48 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 751DE106566B for ; Mon, 25 Oct 2010 08:54:48 +0000 (UTC) (envelope-from igorr@canmos.ru) Received: from sta1.canmos.ru (sta1.canmos.ru [89.107.124.11]) by mx1.freebsd.org (Postfix) with ESMTP id 2EADE8FC08 for ; Mon, 25 Oct 2010 08:54:47 +0000 (UTC) Received: from sta1.canmos.ru (sta1.canmos.ru [89.107.124.11]) by sta1.canmos.ru (Postfix) with ESMTP id D3EA712799D; Mon, 25 Oct 2010 12:54:46 +0400 (MSD) Date: Mon, 25 Oct 2010 12:54:46 +0400 (MSD) From: "Igor V. Ruzanov" To: Erik Trulsson In-Reply-To: <20101025074234.GA71353@owl.midgard.homeip.net> Message-ID: References: <201010250446.o9P4kcid004004@mail.r-bonomi.com> <20101025074234.GA71353@owl.midgard.homeip.net> X-GPG-PUBLIC-KEY: 1024D/494AF6DC 2008-03-20 Igor V. Ruzanov X-GPG-FINGERPRINT: A723 B6CC 11ED A4E2 1909 C4DC 6EDE 9089 494A F6DC MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Kenton Varda , freebsd-questions@freebsd.org, Robert Bonomi Subject: Re: EVFILT_VNODE doesn't scale to large directory trees? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 08:54:48 -0000 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@canmos.ru ! +-------------------------------------------+