I've configured and mounted /var for squid caching and other purposes under Linux. I've noticed that the Linux file system keeps records of when files are created, updated, and accessed. My /var is exclusively used for caching purpose and I do not want to waste disk I/O while updating last-time-read attribute during reads and writes to files. How do I disable access time updates for /var partition?
You can mount file systems with the noatime option. It will prevent inode access times from being updated. Please note that use noatime only when file update times are not critical. Backup client software also use file last update time to sync with backup server. However, the following type of servers may work without problem:
a] Squid caching file
b] News server
c] Web servers etc.
/etc/fstab File
Edit /etc/fstab file and update it as follows:
/dev/sdXY /mount-point ext3 defaults,noatime 1 2
OR
/dev/md1 /var ext3 defaults,noatime 1 2
OR just remount the same from command
mount LABEL=/var -o noatime,nouser,remount,rw
Where,
- noatime - Do not update inode access times on this file system.
I've seen performance benefit of 5-15% with an average of 5% for file server workloads. This hack is only useful busy servers.
Recommend readings:
man 8 mount
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 3 comments… read them below or add one }
You can do the same on a directory level with the nodiratime option.
For security reason you can add noexec,nosuid,nodev.
“…Linux file system keeps records of when files are created, updated, and accessed”
Linux doesn’t keep record of create time, instead it is change time.