Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

With previous versions of Ubuntu (using Ext3 filesystem) I used to tune it for better performance with noticeable results by setting the noatime parameter in /etc/fstab.

Is it still worth it to do that with the Ext4 filesystem, which is now default in Ubuntu? If so, does the procedure changed in some way?

An example of this tuning can be found here.

share|improve this question

2 Answers 2

up vote 41 down vote accepted

On Ubuntu 10.04, relatime is part of the default mount options, unless overridden in /etc/fstab. The previous few releases had relatime explicitly in /etc/fstab. relatime gives the same speed (and flash write cycle conservation) benefits as noatime, without causing trouble to old-fashioned mail notifiers.

The article you cite recommends data=writeback. Ubuntu defaults to data=ordered. Ubuntu's setting is slower in case of heavy disk load, but carries significantly less risk of data loss in case of a crash or power failure. So I would not recommend changing from the Ubuntu default.

Changing commit=5 to commit=100 increases the time window during which data will be lost in case of a crash, for little benefit in most circumstances.

Summary: leave the settings as they are, they were chosen for a reason.


ADDED: There are other things beyond mount options than can make a difference. Switching from ext3 to ext4 is itself often a visible improvement. Here are a few more tips for laptop users.

  • If you have a slow SSD, check out this thread at SU. The important tips are to use tmpfs for /tmp and for the browser cache (and perhaps history).

  • If you have a hard disk and you want it to stop spinning for extended lengths of time, then install noflushd, which allows the disk to spin down by delaying all writes until the RAM is full. (Of course, reads can cause the disk to spin up; you'll want to get into the habit of running cat /files/I/m/likely/to/need >/dev/null before the disk spins down.) In order for noflushd to be effective, turn off all swap and mount your filesystems with something like commit=3600.

    Using noflushd effectively means that your data can remain unwritten to disk for an extended length of time. This is a risk, to be weighed against the benefit of not having any noise or heat coming from the disk for a while. Don't use noflushd if you're not comfortable with that risk.

share|improve this answer
    
I understand the danger of tweaking like this, some of the step on that tutorial I don't agree with, like the comit=100 as you mentioned too. But I'm willing to take some moderated risks to increase performance, since I use a laptop and (almost) regularly backups. –  Decio Lira Aug 13 '10 at 12:58
2  
@Decio: noatime vs atime can make a visible difference, but I'd be surprised that noatime vs relatime would. I've added a few laptop-specific tips to my answer; I've personally observed visible improvements from these tips. Noflushd carries a risk that I was willing to take when I used it. –  Gilles Aug 13 '10 at 13:32
    
Yeah, I was just googling about the differences between noatime and relatime, and you are right. relatime (which is now default in ubuntu) is a good compromise between atime and noatime. –  Decio Lira Aug 13 '10 at 14:55

Yes, it still may make sense to use noatime as of Ubuntu 12.10

relatime is a default mount option. And relatime is much better than atime. The former requires a write for the first read after a write, the latter requires a write for every read. But with noatime each read is free of a write.

This basically means that the number of writes to a disk for relatime mount is close to double relative to a noatime mount other thing being equal. It is a serious concern for partitions on flash memory devices.

The detailed discussion by linux kernel community is at http://kerneltrap.org/node/14148

share|improve this answer
    
thanks for the kerneltrap link –  Craig Constantine Apr 25 '13 at 15:37
    
The factor of two is not correct in general. In theory the factor is between 1 (infinitely often used file) and 2 (infinitely seldom used file). This means, that the true factor is basically 1, as the seldom factors close to 2 do not account significantly in the average. –  Patrick Häcker Jan 5 at 17:56
    
1 is for write-only files. 2 is for all the others. There is no point in write-only files, but they can appear from time to time. So my original estimate should be relevant. –  yanychar Jan 7 at 18:09

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.