Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Mar 1997 08:13:44 -0600
From:      "Jeffrey J. Mountin" <sysop@mixcom.com>
To:        wss@king.cts.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Max # of files in One Directory
Message-ID:  <3.0.32.19970327081343.00ba6ac0@mixcom.com>

next in thread | raw e-mail | index | archive | help
At 12:55 PM 3/26/97 +0000, wss@king.cts.com wrote:
>I am using FreeBSD.
>I currently have one directory containing 7000+ files.
>Is there a limit on the total number of different files that 
>can be in a single directory?  If so, can that limit be changed
>by tweeking with the kernel, if so, where should I look?

I don't know of any limit offhand, but will say that this is not a good
idea and is a good example of when to start using sub-directories.

Just consider how long it takes for a dir to even start writing to the
terminal, now consider that any program accessing a file in such a long
directory listing.

What I know will not work is 'rm *' and it will say "argument list too
long" and choke.

We have one web site that has over 9000 files and directories.  This was
also in the document root for the site.  Mentioned the problems and made
some suggestions.

drwxr-xr-x    9 harry    wheel  527360 Mar 25 23:39 yellowplaces
                                ^^^^^^

[root]:/www/yellowplaces > dir | wc -l
    8544

OK, almost 9000 (more files on the way), but it this took 25 seconds on a
486/DX2-66 on a SCSI drive.  I don't venture into this dir, unless the want
help changing the structure.  8-)


When mail spool directories and home directories for users grow in the
1000+ range it is time to divide things from a to z and speed things up.


-------------------------------------------
Jeff Mountin - System/Network Administrator
jeff@mixcom.net

MIX Communications
Serving the Internet since 1990



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