2.5. File system determinism tips

The order in which journal changes arrive are sometimes not in the order that they are actually written to disk. The kernel I/O system has the option of reordering the journal changes, usually to try and make best use of available storage space. Journal activity can introduce latency through re-ordering journal changes and committing data and metadata. Often, journaling file systems can do things in such a way that they slow the system down.
The default filesystem used by Linux distributions including Red Hat Enterprise Linux 6 is a journaling file system called ext4. An earlier, mostly compatible implementation of the file system called ext2 does not use journaling. Unless your organization specifically requires journaling, consider using ext2. In many of our best benchmark results, we utilize the ext2 file system and consider it one of the top initial tuning recommendations.
Journaling file systems like ext4 record the time a file was last accessed (atime). If using ext2 is not a suitable solution for your system, consider disabling atime under ext4 instead. Disabling atime increases performance and decreases power usage by limiting the number of writes to the filesystem journal.

Procedure 2.7. Disabling atime

  1. Open the /etc/fstab file using your chosen text editor and locate the entry for the root mount point.
    LABEL=/       /       ext4    defaults        1 1
    ...[output truncated]...
    
  2. Edit the options sections to include the terms noatime and nodiratime. noatime prevents access timestamps being updated when a file is read and nodiratime will stop directory inode access times being updated.
    LABEL=/       /       ext4    noatime,nodiratime        1 1
    
  3. The tmpwatch file on Red Hat Enterprise Linux is set by default to clean files in /tmp based on their atime. If this is the case on your system, then the instructions above will result in users' /tmp/* files being emptied every day. This can be resolved by starting tmpwatch with the --mtime option.
    --- /etc/cron.daily/tmpwatch.orig +++ /etc/cron.daily/tmpwatch @@ -3,6 +3,6 @@
    /usr/sbin/tmpwatch 720 /var/tmp
    for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
    	if [ -d "$d" ]; then
    - /usr/sbin/tmpwatch -f 720 "$d" + /usr/sbin/tmpwatch --mtime -f 720 "$d"
    	fi
    
Related Manual Pages
For more information, or for further reading, the following man pages are related to the information given in this section.
  • mkfs.ext2(8)
  • mkfs.ext4(8)
  • mount(8) - for information on atime, nodiratime and noatime
  • chattr(1)