A.21 noatime and atime Commands

The /noatime and /atime commands for a volume allow the administrator to control whether access times are updated when files and directories are read. They are available for NSS on OES 2 SP1 and later. The setting persists across reboots.

Using /noatime is useful for backup, news servers, and mail servers where the extra disk activity associated with updating the access time is not desired. Avoiding the writes associated with updating the access time can result in measurable performance gains.

WARNING:Use the /noatime switch with caution. Do not use the /noatime switch on an NSS volume if the programs and scripts that are used to manipulate its data require access times to be updated. The program or script cannot work as designed, and performance can significantly decrease.

For example, the following programs are affected by using the /noatime switch:

  • NSS Compression: Because the access time is not updated, the compression algorithm eventually considers that all of the files on the NSS volume are unused, and it compresses them. If a file is accessed multiple times in a specified time period, the compression algorithm cannot detect that the access occurred, and it does not decompress the often-used files. Every time a compressed file is accessed, the file must be uncompressed before giving the file to the user. When the file is closed, the uncompressed instance is discarded, and the file remains compressed. Thus, when you enable /noatime on an NSS volume where compression is enabled, you effectively break how compression works, and cause the read access performance of the NSS volume to decrease significantly.

  • Dynamic Storage Technology: Both global policies and volume policies that rely on the access time cannot be enforced.

    • The "Shift Accessed Shadow Files" global parameter controls how files are automatically moved from the secondary storage area to the primary storage. A file is shifted if it is accessed a second time during a specified interval. If the access time is not recorded, the file is never shifted by the policy. You can use /noatime switch on an NSS volume when you use DST if you disable the "Shift Accessed Shadow Files" global parameter, and you do not use the "Last Time Accessed" as a filter for a volume policy. The other filters will work fine.

    • The "Time Stamp Restrictions" identifies which time stamps to use when applying the policy. A policy based on "Last Time Accessed" can be enforced only for files with access times recorded before you disabled the access-time updates.

A.21.1 Using noatime or atime at the Command Line

Issue the following commands in the NSS Console.

nss /atime=volumename

This option enables the updating of access time for both files and directories in a specified volume so that reading a file updates its access time. This is enabled by default.

nss /noatime=volumename

This option disables the updating of access time for both files and directories in a specified volume so that reading a file does not update its access time.

A.21.2 Using noatime in a Cluster Load Script

You can also use the noatime option when mounting an NSS volume in a Novell Cluster Services cluster load script. The atime setting is enabled by default, so it is not necessary to specify it explicitly.

In the cluster load script, modify the ncpcon mount command for the volume:

exit_on_error ncpcon mount /opt="noatime" volumename=volume_id 

When you create a new volume on a cluster-enabled pool, Cluster Services automatically assigns it a volume ID that is unique in the entire cluster and writes the value to the cluster resource load script for the pool. When you add the /opt option to volume’s mount line in the load script, the volume ID is already part of the command.

For example, for a volume named VOL1 and a volume ID of 254, the commands would be:

mount /opt="noatime" VOL1 VOLID=254
exit_on_error ncpcon mount /opt="noatime" VOL1=254

A.21.3 Viewing the atime or noatime Setting

You can view the current setting for the atime attribute by using the nss /volumes command at the NSS Console.

atime attribute is enabled - Attribute is not displayed.

atime attribute is disabled - No Access Time is displayed.