> Hello! > > I'd like to know if there's any problem having like 15,000 (fifteen > thousand) directories in one single directory. There are some potential performance problems, particularly with programs like ls. > I know that the "ls" command would take lots of time to show the results. > But besides that, is there any reason to avoid doing this? > Is ext2 a nice guy? ;-) I believe that ext2 is a decent filesystem; however, it handles directory searching using a linear algorithm. Each search for a name through that 15000 element directory will be executed as a naive linear search. It's better if you structure the data into sub-directories. For example, if the names are alphabetic, you might want to introduce additional hierarchy which divides the names into 26 buckets according to the leading letter; or possibly two-letter buckets. You have to watch subdirectories; each new subdirectory causes the link count of the parent directory to go up by one, because each subdirectory has an entry called ``..'' (dot dot) which is a hard link to the parent. Some systems have an upper limit of 32767 on link counts. I don't know off the top of my head whether the link count in ext2 is a 16 or 32 bit number or whether it's signed or unsigned. - To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to [EMAIL PROTECTED]
Re: Many files in a single directory
Kaz Kylheku <[EMAIL PROTECTED]> Sun, 28 Feb 1999 18:01:39 -0500
- Many files in a single directory Henrique Pantarotto
- Re: Many files in a single dire... Kaz Kylheku <[EMAIL PROTECTED]>
- Re: Many files in a single ... Ingo Molnar
- Re: Many files in a sin... Nicholas J. Leon
- Re: Many files in a single dire... Jack Barnett
- Re: Many files in a single dire... Charles Roten
