Re: Maximum amount of files per directory



On 2007-11-06 18:21, David Bolt wrote:
On Tue, 6 Nov 2007, birre wrote:-

<snip>

If you once have 500000 files in a directory, it will be terrible slow to
do ls

Not really. The time is actually taken up by the formatting and
displaying on a console.

, even after you delete 499999 of them, since the directory itself
will be huge, and never shrink when removing files.

That's wrong, or it is for reiserfs. Both ext3 and xfs retain the
directory size, but directories shrink as files are deleted on a
reiserfs file system.

Merlin wrote he was using ext2 , and this was what I did reply to,
ext2 is very fast for normal operations, but not so fun after a
computer crash.

I recommended reiserfs, but are not sure, since I don't know how
he use the filesystem.

Reiser has no directory or inodes in the same form as the others,
it's more like a database that deliver the result to the OS,
so no surprise the directory does not include deleted files.
( No lost+found either, only loss is possible :-)


drwxr-xr-x 2 davjam users 12050432 2007-11-06 16:11

Ok, I can buy that a normal machine maybe can handle a directory
12MB big , and not so terrible slow as I wrote, but all tests you
did was from RAM , since it was cached.

I have seen machines that don't respond for 30 sec. when doing ls -l.

/bb
.