From owner-freebsd-fs Fri Nov 8 14:26:26 2002 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37AEF37B401 for ; Fri, 8 Nov 2002 14:26:25 -0800 (PST) Received: from scaup.mail.pas.earthlink.net (scaup.mail.pas.earthlink.net [207.217.120.49]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1E3343E4A for ; Fri, 8 Nov 2002 14:26:24 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0224.cvx22-bradley.dialup.earthlink.net ([209.179.198.224] helo=mindspring.com) by scaup.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 18AHa3-0005Nk-00; Fri, 08 Nov 2002 14:26:24 -0800 Message-ID: <3DCC39BD.53818C3E@mindspring.com> Date: Fri, 08 Nov 2002 14:25:01 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: vishal mittal Cc: freebsd-fs@FreeBSD.ORG Subject: Re: Question regarding filesystem performance References: <20021108182420.5418.qmail@web13207.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org vishal mittal wrote: > I am working on a 4.4-RELEASE. I have about 30,000 1K > files in a directory. Any delete or move operation on > a file in this directory introduces unacceptable > delays in some other time-critical processes that I am > running on the machine. > > I am assuming that the delay is because of the large > number of files due to which it takes a longer time to > update the inode information and, delete and move > being atomic operations, they do not relinquish the > CPU for the other processes during that time. No. The delay is because in order to locate the files, it must do an average of 15,000 strncmp()'s on a hit, and 30,000 strncmp()'s on a miss. Use a hashed directory structure, instead. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message