ablog

不器用で落着きのない技術者のメモ

NFS のマウントオプションに関するメモ

ac / noac

Selects whether the client may cache file attributes. If neither option is specified (or if ac is specified), the client caches file attributes.

To improve performance, NFS clients cache file attributes. Every few seconds, an NFS client checks the server's version of each file's attributes for updates. Changes that occur on the server in those small intervals remain undetected until the client checks the server again. The noac option prevents clients from caching file attributes so that applications can more quickly detect file changes on the server.

In addition to preventing the client from caching file attributes, the noac option forces application writes to become synchronous so that local changes to a file become visible on the server immediately. That way, other clients can quickly detect recent writes when they check the file's attributes.

Using the noac option provides greater cache coherence among NFS clients accessing the same files, but it extracts a significant performance penalty. As such, judicious use of file locking is encouraged instead. The DATA AND METADATA COHERENCE section contains a detailed discussion of these trade-offs.

acregmin=n

The minimum time (in seconds) that the NFS client caches attributes of a regular file before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 3-second minimum.

acregmax=n

The maximum time (in seconds) that the NFS client caches attributes of a regular file before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 60-second maximum.

acdirmin=n

The minimum time (in seconds) that the NFS client caches attributes of a directory before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 30-second minimum.

acdirmax=n

The maximum time (in seconds) that the NFS client caches attributes of a directory before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 60-second maximum.

actimeo=n

Using actimeo sets all of acregmin, acregmax, acdirmin, and acdirmax to the same value. If this option is not specified, the NFS client uses the defaults for each of these options listed above.

nfs(5) - Linux man page
  • actimeo=0 にするとファイル/ディレクトリ属性のキャッシュが OFF になり、都度サーバと通信する。
  • actimeo を指定しない場合は60秒間隔でNFSサーバと通信してファイル/ディレクトリ属性のキャッシュを更新する。
  • noac はファイル属性のキャッシュを OFF にし、さらに書き込み時にNFSサーバまで同期書き込みする。

ということか。

  • noac ではディレクトリの属性のキャッシュは OFF にならない。
  • actimeo=0 では書き込み時にNFSサーバに同期書き込みされない。

と解釈してよいのだろうか?

ac は「attributes caches」の略かな?


追記(2015/05/23):

NFS&NIS 第2版

NFS&NIS 第2版

6.3. Mounting filesystems

noac
This option suppresses attribute caching and forces writes to be synchronously written to the NFS server. The purpose behind this option to is let each client that mounts with noac be guaranteed that when it reads a file from the server it will always have the most recent copy of the data at the time of the read. We will discuss attribute caching and asynchronous/synchronous NFS input/output in more detail in Chapter 7.