From owner-freebsd-hackers Thu Jun 22 0:50:42 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from gatekeeper.tsc.tdk.com (gatekeeper.tsc.tdk.com [207.113.159.21]) by hub.freebsd.org (Postfix) with ESMTP id 3DD2F37C1FC for ; Thu, 22 Jun 2000 00:50:39 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from imap.gv.tsc.tdk.com (imap.gv.tsc.tdk.com [192.168.241.198]) by gatekeeper.tsc.tdk.com (8.8.8/8.8.8) with ESMTP id AAA10482; Thu, 22 Jun 2000 00:50:10 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from salsa.gv.tsc.tdk.com (salsa.gv.tsc.tdk.com [192.168.241.194]) by imap.gv.tsc.tdk.com (8.9.3/8.9.3) with ESMTP id AAA14120; Thu, 22 Jun 2000 00:50:09 -0700 (PDT) (envelope-from Don.Lewis@tsc.tdk.com) Received: (from gdonl@localhost) by salsa.gv.tsc.tdk.com (8.8.5/8.8.5) id AAA07430; Thu, 22 Jun 2000 00:50:09 -0700 (PDT) From: Don Lewis Message-Id: <200006220750.AAA07430@salsa.gv.tsc.tdk.com> Date: Thu, 22 Jun 2000 00:50:09 -0700 In-Reply-To: References: X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: "Daniel O'Connor" , Luigi Rizzo Subject: Re: How many files can I put in one diretory? Cc: hackers@FreeBSD.ORG, "Nicole Harrington." Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Jun 22, 5:11pm, "Daniel O'Connor" wrote: } Subject: Re: How many files can I put in one diretory? } } On 22-Jun-00 Luigi Rizzo wrote: } > that sounds insane! Because a name is a name, why dont they call } > those files xx/yy/zz/tt.html and the like, to get down to a more } > reasonable # of files per directory. } > } > Or use a single file and a cgi which extracts things from the right place. } > In such a context, i assume that the best place to do the name lookup } > is in the app, not in the kernel. } } Yeah.. This is why databases where invented :) } } FYI 40000 in a directory really makes directory listings slow.. 2 million would } suck :) Only if directory lookups use a sequential search. Not all filesystem implementations sequentially scan directory entries. Some use btrees or other ways of quickly finding the desired directory entry. Even so, you probably still would want to avoid doing an "ls" or an "echo *" ;-) I'd recommend looking at how squid stores its disk cache. It has a very similar performance problem to solve. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message