Improving ext3 filesystem performance with directory indexing

Directory indexing feature improves file access time in large directories or directories containing many files by using hashed binary trees to store the directory information. It is a good way to enable it for example on a web server which has thousands of files in a single directory:

tune2fs -O dir_index /dev/sda3

Directory index will be created for new files but you can regenarate index with:

e2fsck -D -f /dev/sda3