What is noatime and how does it work?

Linux records information about when files were created and last modified as well as when it was last accessed. There is a cost associated with recording the last access time. ext2/ext3 file systems have an attribute that allows the super-user to mark individual files such that their last access time is not recorded. This may lead to significant performance improvements on often accessed, frequently changing files. To set the attribute to a file, use: <verbatim>#chattr +A filename</verbatim>

For a whole directory tree, do something like: <verbatim>#chattr -R +A /var/spool/

  1. chattr -R +A /cache/
  2. chattr -R +A /home/httpd/ona/

</verbatim> Linux has a special mount option for file systems called *noatime* that can be added to each line that addresses one file system in the /etc/fstab file. If a file system has been mounted with this option, reading accesses to the file system will no longer result in an update to the atime information associated with the file like we have explained above. The importance of the noatime setting is that it eliminates the need by the system to make writes to the file system for files which are simply being read. Since writes can be somewhat expensive, this can result in measurable performance gains. Note that the write time information to a file will continue to be updated anytime the file is written to