Max Files Per Directory

Tony Nelson tonynelson at georgeanelson.com
Sun Jul 17 04:30:50 UTC 2005


At 11:11 PM -0400 7/16/05, Matthew Miller wrote:
>On Sat, Jul 16, 2005 at 02:22:51PM -0400, Tony Nelson wrote:
>> I didn't want to try a million files.  Creation and listing seem to be
>> linear with the number of files, but rm seems quadratic.  I think this
>> indicates that in my current 2.6.12 FC3 kernel using Ext3 the directory
>> data structure is still a list and not a tree.
>
>I get similar results with your script. But try "dumpe2fs | grep features"
>on your filesystem and look for dir_index. (Mine has it.)

Well, it's not so impressive, though maybe by comparison it's good.  As I
say, it acts no better than if it were using a linked list, even if it is
using a tree.

>Then, if you want,
>try using tune2fs to turn it off and retry the test....

On a test (loopback) FS, with dir_index I get results similar to before,
while without dir_index, file creation gets very slow fast (100000 files:
1010 s vs. 34 s), while listing is about the same, and deleting is faster.

So indexing is (and was) being used, but it doesn't help as much as I would
expect, and it is still better to have only a moderate number of files per
directory.
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson at georgeanelson.com>
      '                              <http://www.georgeanelson.com/>




More information about the fedora-list mailing list