From owner-freebsd-questions@FreeBSD.ORG Mon May 19 08:20:06 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3EBAB37B401 for ; Mon, 19 May 2003 08:20:06 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C14F43F3F for ; Mon, 19 May 2003 08:20:05 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h4JFJrXF018909; Mon, 19 May 2003 10:19:53 -0500 (CDT) (envelope-from dan) Date: Mon, 19 May 2003 10:19:53 -0500 From: Dan Nelson To: Gabriel Ambuehl Message-ID: <20030519151953.GF76271@dan.emsphone.com> References: <931912216734.20030519163205@buz.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <931912216734.20030519163205@buz.ch> X-OS: FreeBSD 5.1-BETA X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: questions@freebsd.org Subject: Re: Performance constraints of HUGE directories on UFS2? Any O(F(N)) values? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2003 15:20:06 -0000 In the last episode (May 19), Gabriel Ambuehl said: > Hi, > I was wondering how bad the performance penalties of really large > directories (say >20K entries) on UFS2 are? Reason why I'm asking is > that I'd like to know if it is required to split up so big > directories (along the lines of $firstchar/$secondchar/$filename) or > if UFS2 is performant enough not to care all too much. > > I guess I'm after a O(F(N)) value in a way (I haven't yet decided > which one would be good enough though, suppose I'd like to hear its > O(log(N)) in which case I don't need to care for splitting the dirs > ;-). I think "options UFS_DIRHASH" in your kernel config is what you want. It creates a hash table in memory for large directories. http://www.cnri.dit.ie/Downloads/fsopt.pdf has some benchmark results, and for certain cases dirhash really helps. -- Dan Nelson dnelson@allantgroup.com