8

According to the RHEL 6 documentation about the Relatime Drive Access Optimization:

The kernel used in Red Hat Enterprise Linux 6 supports another alternative — relatime. Relatime maintains atime data, but not for each time that a file is accessed. With this option enabled, atime data is written to the disk only if the file has been modified since the atime data was last updated (mtime), or if the file was last accessed more than a certain length of time ago (by default, one day).

Emphasis mine -- this documentation suggests that the access time updating algorithm can be changed to use a different interval than 24 hours, but I have no idea how to actually accomplish this.

There apparently used to be a sysctl option named fs.relatime_interval as mentioned here, but I cannot find it in my Centos 6.5 kernel (2.6.32-431.)

Is it possible to make this value something arbitrary like 12 hours, 6 hours, etc?

4
  • Could this help? Refresh file access time under Linux / Discard disk read cache Commented Sep 10, 2014 at 2:32
  • Thanks @VolkerSiegel, but unfortunately I don't have a /proc/sys/fs/relatime_interval file like in the answer to that question. It doesn't show up if I do sysctl fs | grep relatime either. I suspect it either changed names or stopped being tunable between 2.6.27 and 2.6.32.
    – mutron
    Commented Sep 11, 2014 at 3:00
  • But you do have the file /proc/sys/fs/file-max for example? Commented Sep 11, 2014 at 3:21
  • Yes, I do in fact have a working proc fs mounted on /proc.
    – mutron
    Commented Sep 12, 2014 at 4:04

2 Answers 2

4

It's immutable in the mainline kernel function relatime_need_update() which checks against the hardcoded value of 24*60*60 (1 day), see the source at e.g.:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/fs/inode.c#n1803

1

Supposedly it can be changed via boot argument.

Likely it can be changed via /proc or /sys but I am not able to find it right now. Answer that Volker linked to refers to a command that does not exist on my system either.

Filesystem mount option strictatime would ensure what you want, but at a quite cost in performance. Relatime semantics were introduced and became default for a reason, it was costly.

1
  • Only on some rehat kernels, it was never merged.
    – Ray Foss
    Commented Oct 15, 2020 at 22:08

You must log in to answer this question.

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