I am developing an applications which reads huge list of directories and check file types using file command and using ext4 file system.

When i look into Ext4 , i see it have two interesting features

  • dir_index
  • filetype

i just enabled both features using

tune2fs -O dir_index /dev/hdXY 
e2fsck -fD /dev/hdXY

my questions are :

  1. Is dir_index works transparently after it is enabled , (ie. ls -lR large_direcory/ performance improved without need for any extra program/config) or have to make it work via programming/scripting?
  2. Indexes are generated transparently ? or need to regenrated using e2fsck -fD /dev/hdXY?
  3. How does Ext3/4 filetype feature works?
  4. I have read XFS have better performance and Reliability over ext3 , how does it compare to ext4 , should i switch?



Answer to your fourth question, or at least something worth thinking:

One thing where XFS shines compared to ext3 (maybe also ext4) is concurrency. XFS scales nicely in multi-processor environment, but with ext3 kjournald does not utilize multiple cores very well.

So if several processes are fighting for disk access simultaneously, then XFS is a very good choice. I think ext4 also gained allocation groups so it might make it better with SMP, too, but that's one thing to keep in mind while benchmarking.

  • Thanks , when i tested on my Corei5 machine using EXT4 , which have 64 concurrent threads ,reading the directory list which have 200k+ files , it got to almost freeze (machine Load Increased up to 17!!) So that may be able improved by XFS. I will check it out.Oh i forgot to note that i am running it on a VM (VMWare Work Station). Can this also come into account? VM's IO are a lot slower rightt? – Phyo Arkar Lwin Nov 11 '10 at 18:26

IIRC dir_index will auto apply itself to any new files after it is created but it will not work retroactively without a fsck. I don't know about this filetype feature. I have never heard that XFS is more reliable over ext3 in fact due to the fact that it doesn't (didn't?) do ... write blocking? (I forget the term) ... it was less reliable due to the longer syncs. Ext4 had the same problem but it got fixed...

  • so it has to be fscked regularly? – Phyo Arkar Lwin Aug 5 '10 at 5:40
  • No. How would that make sense – xenoterracide Aug 6 '10 at 17:31
  • What I said is it will apply itself to any new files after it's created. But it won't apply itself to the old files without a fsck. – xenoterracide Aug 6 '10 at 17:32
  • Sorry english is not my native langauge :D , Thanks , you answer it all! – Phyo Arkar Lwin Aug 7 '10 at 4:07

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.