From owner-freebsd-hackers Thu Jun 22 1: 4:39 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from lorax.ubergeeks.com (lorax.ubergeeks.com [209.145.74.241]) by hub.freebsd.org (Postfix) with ESMTP id A36D137C1E4 for ; Thu, 22 Jun 2000 01:04:35 -0700 (PDT) (envelope-from adrian@ubergeeks.com) Received: from localhost (adrian@localhost) by lorax.ubergeeks.com (8.9.3/8.8.8) with ESMTP id EAA08114; Thu, 22 Jun 2000 04:03:59 -0400 (EDT) (envelope-from adrian@ubergeeks.com) Date: Thu, 22 Jun 2000 04:03:59 -0400 (EDT) From: Adrian Filipi-Martin Reply-To: Adrian Filipi-Martin To: "Nicole Harrington." Cc: hackers@FreeBSD.ORG Subject: Re: How many files can I put in one diretory? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 21 Jun 2000, Nicole Harrington. wrote: > > Hello > I have a user who needs to store a large amount of small html files. Like > around 2 million... > > Assuming FreeBSD 4.0-Stable with Soft Updates, what is a sane number that can > be handled per directory? Softupdates doesn't really help with large directories. The limiting factor is that directories are unsorted so opening a file is a linear search on the directory. Break your files into subdirectories and then maybe another level or two of subdirectoies. Try to keep the directories balanced. Ideally, the path is a perfect hash on the filenames. Still, you might want to think about a DB or somethign other thana large directory for storing 2 million files. Adrian -- [ adrian@ubergeeks.com -- Ubergeeks Consulting -- http://www.ubergeeks.com/ ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message