Saving System Resources with No atime |
Server - CentOS |
Administrators can save a lot of needless writes to the disk by mounting partitions with noatime. Even if a file is read a write will occur to disk when you are using atime. noatime Linux will track several kinds of timestamps on a file; atime, ctime and mtime. The atime stamp is the last time a file was accessed or read. The ctime stamp is when the file inode was last changed. Each object on the Linux file system has identification information for it which is called an inode. This identification information, or inode, contains information about the object like where it is located on the hard disk, the last time it was modified, permissions, etc. If you wanted to see the inodes associated with a file issue this command at a terminal:
The significance of atime is that even if a file is read and not changed, the operating system must make a write to the disk in order to change the atime. On a Linux server there is a lot of reading of files, so basically this process is wasting a lot of resources that could easily go to the operating system by not writing access times. In order to eliminate this problem, mount your partitions with a mount option called noatime. The noatime attribute will tell the system that it does not need to update the time that a file was accessed, dramatically reducing the write times for the file system. This is especially important for large amounts of files that your system only needs to read. This change does not modify the write time or ctime, so that if you write to the file it will be updated. It only has an impact on files that do not change. You can make this change by adding noatime to the options of the partition. Here you can see the / partition has been modified by adding the “noatime” option. Make sure you create a good backup of your operating system and especially Nagios before you make changes to /etc/fstab. A mistake here can be a real problem. Edit /etc/fstab and save the changes.
While the system is running you can remount the partition to test it out.
Now run the mount command to verify the changes.
If you are using CentOS six remember to get the UUID with the blkid command and use the UUID instead of the partition in /etc/fstab. That should do it and you should see an increase in performance. |