66

Having every file be updated just when accessing them sounds like a waste.

What's the catch with mounting a file system with the noatime option. What kind of applications/servers relies on the access time?

splattne
  • 28,348
  • 19
  • 97
  • 147
nos
  • 2,368
  • 3
  • 20
  • 24

4 Answers4

49

Consider relatime:

If you have a newish install (~2008), you can use the relatime mount option. This is a good compromise for atime I think. From the kerneltrap discussion about implementing this new option:

"relative atime only updates the atime if the previous atime is older than the mtime or ctime. Like noatime, but useful for applications like mutt that need to know when a file has been read since it was last modified."

This makes it so most of the applications that need atime will still work, but lessens the disk load -- so it is a compromise. This is the default with recent Ubuntu desktop distributions.

Regarding noatime and nodiratime:

If you are going noatime for files, I wonder if there is a reason not to use nodiratime in addition to noatime so you are not updating the access time on directories as well.

The other reason to keep atime enabled which wasn't mentioned is for auditing purposes. But since who accessed it is not kept and only when, it is probably not that useful for an audit trail.

All of these options can be found in 'man mount 8'.

myrdd
  • 117
  • 4
Kyle Brandt
  • 82,107
  • 71
  • 302
  • 444
  • 1
    +1 relatime has the advantages of noatime and none of the disadvantages. – David Pashley Jul 29 '09 at 11:49
  • 11
    Reading some more about this, it seems noatime also includes nodiratime (it didn't , many many years ago though) – nos Jul 29 '09 at 23:59
  • Note, since Linux 2.6.30 relatime is the default. But in addition the file's last access time is always updated if it is more than 1 day old. This means that a daily backup process or searching in large maildirs may still have unnecessary high I/O impact. – rudimeier May 18 '17 at 05:37
18

There exist applications that will move files off to a secondary storage if they haven't been accessed for a certain time period. Obviously, they need the atime.

Other than that, I don't see much use for this (anymore), especially as file managers these days have a tendency to open files to generate previews, therefore modifiying the atime just while browsing a directory.

I always mount with noatime these days.

Sven
  • 97,248
  • 13
  • 177
  • 225
15

There are very little there are some applications that rely on this for example Mutt cannot determine if the folder has received new mail since last visited.

Generally I and others think that mounting noatime is a good idea.

James
  • 2,212
  • 1
  • 13
  • 19
12

the main disadvantage that hasn't been mentioned yet is that if you have a tmpreaper process (i.e. a program that deletes files in /tmp that haven't been accessed for a while), it could delete tmp files that are still in use.

relatime is a better option than noatime. it only updates atime if the file has been modified since the last atime update. this has obvious benefits for mail clients. it still doesn't fix the tmpreaper issue (a file may be read from /tmp for ages without being written to).

overall, the disadvantages are minor (non-existant except for a few special cases), and the performance benefit is significant.

cas
  • 6,653
  • 31
  • 34