2

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?

Thanks!

2 Answers 2

1

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.

1
  • 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? Nov 11, 2010 at 18:26
1

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...

4
  • so it has to be fscked regularly? Aug 5, 2010 at 5:40
  • No. How would that make sense Aug 6, 2010 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. Aug 6, 2010 at 17:32
  • Sorry english is not my native langauge :D , Thanks , you answer it all! Aug 7, 2010 at 4:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .