Reduce disk I/O by mounting partitions with noatime

Valic —  September 28, 2012 — Leave a comment

Many sysadmins think about performance tunning as optimizing loops, memory use, algorithms, etc.But you don’t get a massive performance gains from optimizing CPU and memory use, but from eliminating I/O calls.

CPU, bandwidth, and memory strangulation is turning into additional and additional common on shared servers and virtualization systems, but practical disk throttling isn’t even on the horizon from what I can tell. Improper I/O usage from any app affects everybody.

Step1. Edit /etc/fstab file and add noatime for your root file system:

vim /etc/fstab

And then add noatime after errors=remount-ro

cat /etc/fstab
# /etc/fstab: static file system information.
# Use ‘blkid’ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda1 during installation
UUID=136c3e1f-523e-40f3-b5cb-7ab634b16c18 /               ext3    errors=remount-ro,noatime 0       1
# swap was on /dev/sda5 during installation
UUID=48802a17-2ec4-4d08-942f-e56a438e7c6b none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0

Step2. Remount the modified partitions for the changes to take effect:

mount -o remount /

Step3. Now if you want to check if your partition is mounted with noatime run the following command:

/dev/sda1 on / type ext3 (rw,noatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sdb1 on /mnt/hdd type ext3 (rw)



Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

No Comments

Be the first to start the conversation.

Leave a Reply