Disabling access time (atime) updates on ZFS file systems

When running web servers, it is extremely common for website administrators to disable access time updates on file systems that contain content. This alleviates the need for the kernel to update the access time of a file each time it is requested, and less work in the kernel means more cycles are available for serving content.

Prior to the introduction of the Solaris ZFS file system, you could disable access time updates by adding the noatime mount option to the desired entry in /etc/vfstab. Since ZFS stores the file system attributes with the file system, this allows the attributes (e.g., compress content, checksum content, disable atime updates, etc.) to move with the file system. To view the attributes of a ZFS file system, you can run the zfs utility with the “get” option and the file system to retrieve attributes from:

$ zfs get all home/apps

NAME             PROPERTY       VALUE                      SOURCE
home/apps        type           filesystem                 -
home/apps        creation       Sat Jul  8 23:14 2006      -
home/apps        used           170M                       -
home/apps        available      54.9G                      -
home/apps        referenced     170M                       -
home/apps        compressratio  1.00x                      -
home/apps        mounted        yes                        -
home/apps        quota          none                       default
home/apps        reservation    none                       default
home/apps        recordsize     128K                       default
home/apps        mountpoint     /home/apps                 default
home/apps        sharenfs       off                        default
home/apps        checksum       on                         default
home/apps        compression    off                        default
home/apps        atime          on                         default
home/apps        devices        on                         default
home/apps        exec           on                         default
home/apps        readonly       off                        default
home/apps        zoned          off                        default
home/apps        snapdir        hidden                     default
home/apps        aclmode        groupmask                  default
home/apps        aclinherit     secure                     default

As you can see from the output above, there are numerous attributes available. The attribute to control access time updates is “atime,” and it can be switched off with the zfs “set” option:

$ zfs set atime=off home/apps

Once a file system attribute is modified, the change will immediately take effect, no mounting or unmounting required:

$ zfs get all home/apps

NAME             PROPERTY       VALUE                      SOURCE
home/apps        type           filesystem                 -
home/apps        creation       Sat Jul  8 23:14 2006      -
home/apps        used           170M                       -
home/apps        available      54.9G                      -
home/apps        referenced     170M                       -
home/apps        compressratio  1.00x                      -
home/apps        mounted        yes                        -
home/apps        quota          none                       default
home/apps        reservation    none                       default
home/apps        recordsize     128K                       default
home/apps        mountpoint     /home/apps                 default
home/apps        sharenfs       off                        default
home/apps        checksum       on                         default
home/apps        compression    off                        default
home/apps        atime          off                        local
home/apps        devices        on                         default
home/apps        exec           on                         default
home/apps        setuid         on                         default
home/apps        readonly       off                        default
home/apps        zoned          off                        default
home/apps        snapdir        hidden                     default
home/apps        aclmode        groupmask                  default
home/apps        aclinherit     secure                     default

I have only worked with ZFS for two months, and am impressed with that I see so far. Once ZFS has better methods to detect disk failures, the ability to remove devices and expand RAIDZ sets, support for “/,” and the known performance issues are addressed, it will be the final word in Solaris file systems.

One Comment

milind  on September 17th, 2011

Can you let me know of atime be disabled dynamically when applications/databases are running on the server?

Leave a Comment