Re: Maximum amount of files per directory



On 2007-11-06 10:22, Merlin Morgenstern wrote:
Andreas schrieb:
Hi,

Merlin Morgenstern wrote:
thank you for your reply. How can I find out which file system I am running on the machine?

The mount command or the /etc/fstab file.
Lookups should be in some O(log n).
I am sorry, what does that mean? Can you be more specific?

It means that the time would increase, but not linear. Having ten times
as many files won't take ten times longer.

kindr regards,
Andreas

HI Anreas,

the filesystem is:
/dev/sda7 on /home type ext2 (rw,acl,user_xattr)

Do you believe I will notice a performance problem lets say with 500.000 files in one directory?

Best regards,

Merlin

If you once have 500000 files in a directory, it will be terrible slow to
do ls , even after you delete 499999 of them, since the directory itself
will be huge, and never shrink when removing files.
The only way to clean it is to make a new directory.

If your application know the name and call the file, it will not be so slow,
it's just the other way, when listing the contents of a directory.

Reiserfs is better to handle this, and if you turn off acl and xattr you make
it a bit faster. (unless you need those features)

/bb
.



Relevant Pages