From: douglerner on
We have a FreeBSD 6.4 system running a certain server. There is one
particular directory currently containing about 3 million separate
files.

I was worried because I know in the past that it was considered unwise
to have too many files in one directory. I've approached the network
administrator about this who reported back to me not to worry about it
because things appear to be working and, "Apparently current versions
of the OS support a lot more inodes than we realized."

Somehow that still doesn't satisfy me. I'd like to know if we are
approaching the end of a cliff or something.

Are there any ways of knowing for sure what the maximum number of
files allowed in a single directory are?

Thanks,

doug


From: patpro ~ Patrick Proniewski on
In article
<1a7d018a-52a8-42a0-b860-c6c1cfe1e881(a)f17g2000prh.googlegroups.com>,
douglerner <douglerner(a)gmail.com> wrote:

> Somehow that still doesn't satisfy me. I'd like to know if we are
> approaching the end of a cliff or something.
>
> Are there any ways of knowing for sure what the maximum number of
> files allowed in a single directory are?

Don't know for sure about the number of files in a single directory, but
if you are worried about inode exhaustion you can try `df -i` to check
if you have enough inodes left on each device.

patpro

--
A vendre ! http://www.patpro.net/blog/index.php/2008/01/12/133
From: Dominic Fandrey on
On 04/03/2010 09:06, patpro ~ Patrick Proniewski wrote:
> In article
> <1a7d018a-52a8-42a0-b860-c6c1cfe1e881(a)f17g2000prh.googlegroups.com>,
> douglerner <douglerner(a)gmail.com> wrote:
>
>> Somehow that still doesn't satisfy me. I'd like to know if we are
>> approaching the end of a cliff or something.
>>
>> Are there any ways of knowing for sure what the maximum number of
>> files allowed in a single directory are?
>
> Don't know for sure about the number of files in a single directory, but
> if you are worried about inode exhaustion you can try `df -i` to check
> if you have enough inodes left on each device.
>
> patpro
>

Fortunately tunefs supports changing these limits by specifying
different expected average file sizes and number of files per
directory.

So if you run into trouble your sysadmin should be able to fix
it, with a single command.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
From: Michael Sierchio on
douglerner wrote:
> We have a FreeBSD 6.4 system running a certain server. There is one
> particular directory currently containing about 3 million separate
> files.
>
> I was worried because I know in the past that it was considered unwise
> to have too many files in one directory. I've approached the network
> administrator about this who reported back to me not to worry about it
> because things appear to be working and, "Apparently current versions
> of the OS support a lot more inodes than we realized."
>
> Somehow that still doesn't satisfy me. I'd like to know if we are
> approaching the end of a cliff or something.
>
> Are there any ways of knowing for sure what the maximum number of
> files allowed in a single directory are?

Do you understand *why* it was unwise to have "too many" directory
entries in the past? Because the directory was searched in a linear
fashion. Performance tended to degrade somewhere around 1000 entries,
and then became catastrophically slow.

If HASHDIRS is enabled in the kernel, UFS behaves well even
with very large numbers of directory entries.

- M