Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I encounter a performance problem with two HDDs. One is fast but mounted remotely through NFS, the other is local (ext4) but slow.

No, exchanging the two drives is not an option, because it would make the installation on the other system suffer from it.

I have the subjective impression that most of the performance loss is happening during the writing of cached data (in both cases: local and remote).
An other empirical evidence is that sync takes always less that a second, even after lots of writing. Again, for me it means: the write cache is too small, or is used too little, or similar.

The question is: can I improve performance with some mount options?

I have found in mount's man page some option which might have to do with performance: max_batch_time, delalloc. But I can't guess what's the default, what they do, ...

Additional question: Is there a chance of improving performance by reformatting an ext4 partition with different options?

share|improve this question
    
Do you have the ext4 drive formatted with extents support? –  Broam Dec 4 '09 at 15:59
    
I have formatted it with Opensuse's default options from Yast. I'm very sure it's enabled. –  java.is.for.desktop Dec 4 '09 at 16:17
    
How slow is slow? If you don't measure, you can't know if you are already very close at the hw highest performance (if so, your only option is to buy new hw - otherwise you can spend time trying to optimize your settings) –  Davide Dec 4 '09 at 16:26
add comment

2 Answers

up vote 3 down vote accepted

What do you need the drive to do? Performance often varies by file system type & what task is being performed.

Setting noatime on your partition or changing to a reiserfs might give some small performance boost, but you might create NFS problems for yourself. If the local ext4 disk is slower than an NFS mount, I think something else is going on. I think you need to see what else is going on in your system that is keeping your disk from getting around to your write tasks. Consider looking at what is doing all this writing. Lets say something is pounding /tmp. Moving /tmp to it's own partition would help with the rest of your local partitions.

You may be suffering from a need to defrag your drive. Although linux filesystems don't suffer from fragmentation as dramatically as NTFS, they do fragment over time. Since ext4 defrag is not too straightforward (kernel mode required), you might just reformat since you seemed willing to try a new file system type.

Mount settings to try:

  1. noatime & nodiratime
  2. no acl
  3. data=writeback,nobh
  4. delalloc - which should already be the default - no need to set.
  5. commit=N The default is 5 seconds, good for safety, 'bad' for performance. Setting it to higher values might cause you to lose 'N' seconds of work if your machine crashes. Journaling still preserved, so the disk is unaffected.
  6. inode_readahead=n
  7. max_batch_time=N
share|improve this answer
    
"noatime" also has the same effect of "nodiratime", no need to use both parameters. lwn.net/Articles/245002 –  doodly doo Jun 23 at 17:27
add comment

I use noatime to decrease the overall write-access time.

share|improve this answer
    
Yes, I'm already using noatime and nodiratime and data=writeback. –  java.is.for.desktop Dec 4 '09 at 16:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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