Thursday, March 26, 2009

Ext3 dir_index option.

Funny how thing sometimes come through. A friend asks me how to improve performance of a filesystem, if possible Debian GNU/Linux, so that it behaves well with a large amount of files.
Normally you want bigger IO, or huge files, or some availability feature but, this one is so important and understimated.
So, we started looking for benchmarks of filesystems oriented towards a modern solution which included even "out of boundary" solutions like OCFS2 or ZFS.

So, suddenly we found this fine H-Online article on how to tune Ext3 filesystem. And, there it is:

"The dir_index option can also be enabled after creating the file system using the

tune2fs -O dir_index

command, although it will only be applied to newly created directories. The existing directories of an unmounted file system can be changed to dir_index using the

e2fsck -fD

command after the dir_index feature has been enabled. For safety reasons, this should be followed by another forced e2fsck run by including option -f."

Sometimes the option you need is right below your nose!.
Please feel free to share any experience on handling directories with large amount of files.

No comments: