Do large folder sizes slow down IO performance?
Yes, large directory sizes can be a problem. It's generally best to avoid them by hashing files into subdirectories. If that's not an option, there is an ext3 feature that can dramatically improve the lookup performance in large directories:
tune2fs -O dir_index /dev/$DEVICE
e2fsck -D /dev/$DEVICE
This enables b-tree hashes of directory index data, dramatically improving lookup time. Of course, it's possible your install already has this enabled. You can check by running this command and looking for dir_index
in the output:
tune2fs -l /dev/$DEVICE | grep 'features:'
EDIT:
Also, you may want to consider setting noatime
as a mount option. It's not a specific tweak for large directories, but can offer considerable performance improvements whenever lots of filesystem activity is taking place.