Zfs - what does atime update?

It is widely documented that on zfs atime updates the access time on zfs.
Where is the access time updated on Solaris 11.2?

If I create file atimetest.txt under rpool/export/home:

# zfs list rpool/export/home
NAME                USED  AVAIL  REFER  MOUNTPOINT
rpool/export/home  13.3G  21.0G  13.3G  /export/home
#
# ls -lt /export/home/atimetest.txt
-rw-r--r--   1 root     root          15 Sep  9 09:31 /export/home/atimetest.txt
# cat /export/home/atimetest.txt
this is a test
#

The atime is set to on, so I set it to off:

# zfs get atime rpool/export/home
NAME               PROPERTY  VALUE  SOURCE
rpool/export/home  atime     on     default
# zfs set atime=off rpool/export/home
# zfs get atime rpool/export/home
NAME               PROPERTY  VALUE  SOURCE
rpool/export/home  atime     off    local
#

I then check the time, run ls -ld against the directory, run ls -tl against the file:

# date
Wednesday,  9 September 2015 09:39:10 BST
# ls -ld /export/home
drwxr-xr-x  11 root     root          12 Sep  9 09:31 /export/home
# ls -lt /export/home/atimetest.txt
-rw-r--r--   1 root     root          15 Sep  9 09:31 /export/home/atimetest.txt
#

Then cat the file from /:

# pwd
/
# cat /export/home/atimetest.txt
this is a test
#

Checking the directory with ls -ld and checking the file with ls -lt shows no update for the access time:

# ls -ld /export/home
drwxr-xr-x  11 root     root          12 Sep  9 09:31 /export/home
# ls -lt /export/home/atimetest.txt
-rw-r--r--   1 root     root          15 Sep  9 09:31 /export/home/atimetest.txt
#

So, where is the access time updated?
I can see the setting of atime=off in zpool history:

2015-09-09.09:36:17 zfs set atime=off rpool/export/home

but no update for access time.
I'd like to set atime=off for zfs on application servers, but would like a before and after image to access the change.
This behaviour is replicated on both solaris 10 and 11 x86.

If you set atime=off , you are telling ZFS not to update access times on that filesystem. If you want to record access time updates, set atime=on .

By using stat command, you can see that information.

# stat somefile.txt
  File: `somefile.txt'
  Size: 9               Blocks: 2          IO Block: 512    regular file
Device: 475001dh/74776605d      Inode: 1161        Links: 1
Access: (0664/-rw-rw-r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-09-09 13:14:00.384836768 +0200
Modify: 2015-09-09 13:14:00.385346153 +0200
Change: 2015-09-09 13:14:00.385994348 +0200

If you change atime to off, the Access part will not be update when you access the file and you will gain minor to none performance depending on the filesystem structure.

Hope that helps
Regards
Peasant.

Alternatively, you can use the portable POSIX way to display the file access time:

ls -lu somefile.txt

Note that with certain workloads, disabling atime might have more than a "minor to none" performance gain. It can dramatically reduce the number of I/Os (possibly down to zero) if your applications are constantly reading a large set of small files.

Don,Peasant,jlliagre,

Thank-you for your replies; my post was to determine how I could see the effect of setting atime=off for zfs. Unfortunately I cannot install the gnu utils for solaris to get stat available, due to rigid change control. I have not come across ls -lu before; I have tried repeatedly catting the file atimetest.txt today, but that does not show any change in the ls -lu output.
I am happy to accept that the default setting for atime (=on) updates the inode data, which is something I cannot see easily, in my current setup.

J

Most GNU utils are already there but GNU stat is unfortunately not part of them. Solaris ls has been extended to support some GNU options though, and they provide the information required.

Here is a test showing the access time changing on Solaris 11.2:

$ ls -l foo
-rw-r-----   1 jlliagre staff          5 Mar 20 01:20 foo
$ ls -l --full-time foo
-rw-r-----   1 jlliagre staff          5 2015-03-20 01:20:15.576863674 +0100 foo
$ ls -lu --full-time foo
-rw-r-----   1 jlliagre staff          5 2015-04-25 08:52:32.741753870 +0200 foo
$ cat foo > /dev/null
$ ls -lu --full-time foo
-rw-r-----   1 jlliagre staff          5 2015-09-10 14:59:57.582793533 +0200 foo