Difference between revisions of "HowTo Disable The "relatime" Method For File "atime" Updates"

From NST Wiki
Jump to navigationJump to search
('''relatime''')
('''relatime''')
Line 8: Line 8:
  
 
=='''relatime'''==
 
=='''relatime'''==
The [http://www.kernel.org/ Linux Kernel] supports the "'''Relative atime'''" ('''relatime''') update method.  A "'''relatime'''" update will only updated the "'''atime'''" field if the previous "'''atime'''" is older than the "'''mtime'''" (modify time) or "'''ctime'''" (change status time) for the file. Therefore, only "'''One'''" "'''atime'''" field update will occur after either a "'''mtime'''" or "'''ctime'''" change has occurred for the file regardless of the number of subsequent file read access attempts that occurs.
+
The [http://www.kernel.org/ Linux Kernel] supports the "'''Relative atime'''" ('''relatime''') update method.  A "'''relatime'''" update will only updated the "'''atime'''" field if the previous "'''atime'''" is older than the "'''mtime'''" (modify time) or "'''ctime'''" (change status time) for the file. Therefore, only "'''One'''" "'''atime'''" field update will occur after either a "'''mtime'''" or "'''ctime'''" change regardless of the number of subsequent file read access attempts that occurs.
  
 
This technique can avoid a significant number of metadata "'''atime'''" updates. It's similar to the "'''noatime'''" mount option, but useful for applications like "[http://www.mutt.org/ mutt]" that need to know when a file has been read since it was last modified.
 
This technique can avoid a significant number of metadata "'''atime'''" updates. It's similar to the "'''noatime'''" mount option, but useful for applications like "[http://www.mutt.org/ mutt]" that need to know when a file has been read since it was last modified.
  
 
'''NST''' has the "'''relatime'''" [http://www.kernel.org/ Kernel] option enabled by default.
 
'''NST''' has the "'''relatime'''" [http://www.kernel.org/ Kernel] option enabled by default.

Revision as of 21:55, 4 August 2008

Overview

This "HowTo" explains various ways to disable the "relatime" method in the Linux Kernel for updating the "atime" field for a file when a process "read" occurs. One should consider only disabling the "relatime" method for audit or debugging purposes. A significant disk I/O performance hit may occur for an active Linux server if this method is disabled.

atime

The "Access time" field for a file within a given file system is know as: "atime". When a process reads a file, the "atime" field is updated with the current date/time for this access. Completely disabling "atime" updates using the "noatime" mount flag is probably one of the biggest performance tweaks that a Linux administrator can make. An active Linux server is continually reading files which generates a significant number of "atime" updates. This translates to numerous metadata updates made to the file system by writes to the physical disk which can lead to poor I/O performance.

relatime

The Linux Kernel supports the "Relative atime" (relatime) update method. A "relatime" update will only updated the "atime" field if the previous "atime" is older than the "mtime" (modify time) or "ctime" (change status time) for the file. Therefore, only "One" "atime" field update will occur after either a "mtime" or "ctime" change regardless of the number of subsequent file read access attempts that occurs.

This technique can avoid a significant number of metadata "atime" updates. It's similar to the "noatime" mount option, but useful for applications like "mutt" that need to know when a file has been read since it was last modified.

NST has the "relatime" Kernel option enabled by default.