Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jun 2000 08:29:18 -0700
From:      Arun Sharma <adsharma@sharmas.dhs.org>
To:        nicole@unixgirl.com
Cc:        hackers@freebsd.org
Subject:   Re: How many files can I put in one diretory?
Message-ID:  <200006221529.IAA30485@sharmas.dhs.org>
In-Reply-To: <XFMail.000621234237.nicole@unixgirl.com>
References:  <XFMail.000621234237.nicole@unixgirl.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 21 Jun 2000 23:42:37 -0700 (PDT), Nicole Harrington. <nicole@unixgirl.com> 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?

I investigated this for about 25k files and it seemed to be fine. Note that 
if you keep the in memory directory cache (which is hashed) large enough,
you might be able to get away with a one time linear search cost in the
directory. So your worst case is scanning two million filenames in a directory.
The average case can be made O(1)

Also, picking names intelligently is also a good idea -

foooooooooooooooooooooooobaaaaaaaaaaaaaaaaar123456789

is a bad idea, because the string comparision routine has to skip over
the first 50 character, before it finds a mismatch. I think netscape 
commits this sin.

	-Arun


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006221529.IAA30485>