I have an ext2 filesystem with a maximum number of inodes per directory (somewhere around 32k), and also a maximum number of inodes in the entire filesystem (somewhere around 350m). Because I'm using this filesystem as a datastore for a service that has in excess of 32k objects, I'm distributing those objects between multiple subdirectories (like a dictionary separates A-K and L-Z).

My question is this:

Is there any significance to the tree depth when I'm building these inodes? Is there a significant difference or limitation that's going to affect my service if I choose "/usr/www/service/data/a_k/aardvark" over "/data/a_k/aardvark"?

  • Oh, my! There are still ext2 in the wild?!!! Can I touch it? I think it would be better for you to switch to ext3 or ext4 because of dir_index capability. – Mircea Vutcovici Jan 11 '11 at 5:54

There shouldn't be any measurable difference unless you have a really memory starved system. The OS will cache the /usr/www/service/data/ directory inode and do searches from there, not go over whole hierarchy each time a file is accessed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.