Ce contenu n'est pas disponible dans la langue sélectionnée.
4.11. Configuring atime Updates
Each file inode and directory inode has three time stamps associated with it:
ctime— The last time the inode status was changedmtime— The last time the file (or directory) data was modifiedatime— The last time the file (or directory) data was accessed
If
atime updates are enabled as they are by default on GFS and other Linux file systems then every time a file is read, its inode needs to be updated.
Because few applications use the information provided by
atime, those updates can require a significant amount of unnecessary write traffic and file-locking traffic. That traffic can degrade performance; therefore, it may be preferable to turn off atime updates.
Two methods of reducing the effects of
atime updating are available:
- Mount with
noatime - Tune GFS
atimequantum
4.11.1. Mount with noatime Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
A standard Linux mount option,
noatime, can be specified when the file system is mounted, which disables atime updates on that file system.
Usage Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
mount BlockDevice MountPoint -o noatime
mount BlockDevice MountPoint -o noatime
BlockDevice- Specifies the block device where the GFS file system resides.
MountPoint- Specifies the directory where the GFS file system should be mounted.
Example Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
In this example, the GFS file system resides on the
/dev/vg01/lvol0 and is mounted on directory /gfs with atime updates turned off.
mount /dev/vg01/lvol0 /gfs -o noatime
mount /dev/vg01/lvol0 /gfs -o noatime
4.11.2. Tune GFS atime Quantum Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
When
atime updates are enabled, GFS (by default) only updates them once an hour. The time quantum is a tunable parameter that can be adjusted using the gfs_tool command.
Each GFS node updates the access time based on the difference between its system time and the time recorded in the inode. It is required that system clocks of all GFS nodes in a cluster be synchronized. If a node's system time is out of synchronization by a significant fraction of the tunable parameter,
atime_quantum, then atime updates are written more frequently. Increasing the frequency of atime updates may cause performance degradation in clusters with heavy work loads.
To see the current values of the GFS tunable parameters, including
atime_quantum, you can use the gfs_tool gettune, as described in Section 4.5, “Displaying GFS Tunable Parameters”. The default value for atime_quantum is 3600 seconds.
The
gfs_tool settune command is used to change the atime_quantum parameter value. It must be set on each node and each time the file system is mounted. The setting is not persistent across unmounts.
Usage Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Changing the
atime_quantum Parameter Value
gfs_tool settune MountPoint atime_quantum Seconds
gfs_tool settune MountPoint atime_quantum Seconds
MountPoint- Specifies the directory where the GFS file system is mounted.
Seconds- Specifies the update period in seconds.
Example Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
In this example, the
atime update period is set to once a day (86,400 seconds) for the GFS file system on mount point /gfs.
gfs_tool settune /gfs atime_quantum 86400
gfs_tool settune /gfs atime_quantum 86400