Every time you create, modify or simply access a file, Linux dutifully records the current time stamp in its directory structures. In particular, the latter update obviously implies a penalty on file access time. Even if you merely read a file (without changing anything), Linux updates the file's inode (see the Resources section for more on inodes) with the current time stamp. Because writes obviously require some time, doing away with these updates results in performance gains.
In order to achieve this enhancement, you need to change the way the file system is mounted. Working as the root user, implement cat /etc/fstab to get the following result: Given this output, the best candidates for the optimisation are / and /devihddl; !boot is used only when booting, swap is out of bounds for you, and the others are not hard disks.
Making the change is simple. With your favourite text editor, add noatime to the options in the fourth column. When you are done, issue the mount -a command to remount all partitions, and then issue a plain mount to check whether the changes were done (Listing 2). $ mount -a $ mount /dev/hda3 on / type reiserfs Irw,noatime,acl,user_xattr) proc on /proc type proc (rw)
sysfs on Isys type sysfs (n.)
debugfs on Isys/kernel/debug type debugfs (rwl udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5) /dev/hdal on /boot type ext2 (rw,acl,user_xattr) /dev/hddl on /media/disk2 type reiserfs (rw, noatlme)
Notice the noatime parameters in the /devihda3 and /devihddl lines. Those mean you did everything right, and access times are no longer being recorded.
By the way, if you research this on the Web, you may find a reference to another option, nodiratime, which has to do with directories. Do not bother setting this option, because noatime implies nodiratime.
I ran some tests (creating lots of files, and copying them to Idev/null) and timed the results both with and without the noatime option and found some small performance enhancements-every little bit helps. Now, if you've gotten this far, you're ready for the big one: enhancing your kernel.



Reply With Quote
Copyright Techfuels
Bookmarks