Maximum number of files in one ext3 directory while still getting acceptable performance?

Posted by knorv on Server Fault See other posts from Server Fault or by knorv
Published on 2010-04-05T16:12:40Z Indexed on 2010/04/07 1:33 UTC
Read the original article Hit count: 466

I have an application writing to an ext3 directory which over time has grown to roughly three million files. Needless to say, reading the file listing of this directory is unbearably slow.

I don't blame ext3. The proper solution would have been to let the application code write to sub-directories such as ./a/b/c/abc.ext rather than using only ./abc.ext.

I'm changing to such a sub-directory structure and my question is simply: roughly how many files should I expect to store in one ext3 directory while still getting acceptable performance? What's your experience?

Or in other words; assuming that I need to store three million files in the structure, how many levels deep should the ./a/b/c/abc.ext structure be?

Obviously this is a question that cannot be answered exactly, but I'm looking for a ball park estimate.

© Server Fault or respective owner

Related posts about ext3

Related posts about capacity-planning