+ Reply to Thread
Results 1 to 4 of 4

Thread: noatime mount option

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Default noatime mount option

    Hi everybody!

    We're using CentOS on our servers and I was wondering what is the general population's (and maybe steadfast's) opinion on running with the noatime mount option on ext3 file systems. For those of you that don't know what it is, by default the OS keeps the date & time each file was accessed by one of the apps (like apache, php and so on). It can be useful information, but it also means each time a file is read, the OS has to write to the disk to update the access time (atime). It happens EVEN when the file is cached in memory, which kind of defeats the purpose of the cache system (right, you save a READ but you still need to write to the disk).

    It is especially important for users like us, that serves millions of small files each day. I did test it on one of our servers, and the load and IO wait time both decreased dramatically. It might also help hard drives; we lost quite a few and maybe it's because we're putting too much stress on them. Right now I'm very very tempted to switch all of our servers to noatime, but I was wondering if any of you have had bad experience with it. I understand some backup programs might not like it, and find -amin, -atime and -anewer won't work, and the cron cleaning up /tmp could be confused. But besides that, on a standard apache/php server, any problems?

    BTW I did google but didn't find much; I'm more interested with real-life experiences

    Thanks for your time,
    Dan

  2. #2
    I love LAMP.
    Join Date
    Jul 2004
    Location
    Chicago, Illinois, United States
    Posts
    201

    Default

    We do recommend setting noatime on partitions with a lot of activity. Most actions update the atime on files, so the information is of limited usefulness anyway and there's definitely a noticeable drop on IO load by not having to write those updates to disk constantly.
    Kevin Stange
    Chief Technology Officer
    Steadfast Networks
    http://steadfast.net
    kevin@steadfast.net

  3. #3
    Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Default

    Turns out it's possible to set noatime on specific folders/files too, using a special attribute. It's better IMO because we don't have to disable noatime on the whole partition (leaving atime on for /tmp and /var since they're on the same mount point), and because we don't have to edit fstab and risk some typo that would prevent the server from booting up. The attribute is A and can be set using chattr. For instance:

    chattr -R +A /home

    will set the A (noatime) attribute on all files/directories under /home . And the A attribute is inherited by new files/directories so it's a one-time command. I just tried it on one of our servers and the load went from 12 to 1, it definately helps in cases like ours (lots of small files).

  4. #4
    Member
    Join Date
    Mar 2008
    Posts
    66

    Default

    Is there any performance difference between setting the noatime parameter with the chattr -R +A /directory option vs. mounting the partition with the noatime option?

    I notice you leave atime on for /var and /tmp -- what real-world benefit does this bring, or possibly I should ask, what really benefits in the real-world from having the atime parameter left on?

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts