disable NFS client cache

來源:互聯網
上載者:User
To Change the Default
Mount Options
  1. Include the NFS mount options in your /etc/fstab
    file or automounter map as needed. Table 2-2 “NFS Mount Options”
    and Table 2-3 “NFS Caching Options”
    list the NFS mount options.

  2. If you changed the mount options in the automounter
    master map, you must run the automount
    (1M)
    command, on each client that uses the map, before your changes will
    take effect.

    If you changed the mount options for a directory that is currently
    mounted, you must unmount and remount it before your changes will
    take effect. Issue the following commands:

    /usr/sbin/umount local_directory
    /usr/sbin/mount local_directory

Several NFS mount options allow you to change the length of
time file and directory attributes remain cached on the NFS client.
By default, an NFS client caches certain attributes of files and
directories, like their ownership, size, and modification time.
If a user on an NFS client is making a series of changes to a file,
the changes to the file's attributes are cached and modified
locally on the client, and finally, the resulting attributes are
sent to the server.

Table 2-3 NFS Caching Options

noac

(default:
not specified)

If
specified, this option prevents the NFS client from caching attributes
for the mounted directory.

Specify
noac
for a directory
that will be used frequently by many NFS clients. The noac
option ensures that the file and directory attributes on the server
are up to date, because no changes are cached on the clients. However,
if many NFS clients using the same NFS server all disable attribute
caching, the server may become overloaded with attribute requests
and updates. You can also use the actimeo
option to set all the caching timeouts to a small number of seconds,
like 1 or 3.

If you specify noac
,
do not specify the other caching options.

nocto

(default:
not specified)

If
specified, this option suppresses fresh attributes when opening
a file.

Specify
nocto
for a file
or directory that never changes, to decrease the load on your network.

acdirmax=n

(default=60)

The
maximum number of seconds a directory's attributes are
cached on the NFS client. When this timeout period expires, the
client flushes its attribute cache, and if the attributes have changed,
the client sends them to the NFS server.

For
a directory that rarely changes or that is owned and modified by
only one user, like a user's home directory, you can decrease
the load on your network by setting acdirmax=120
or higher.

acdirmin=n

(default=30)

The
minimum number of seconds a directory's attributes are
cached on the NFS client. If the directory is modified before this
timeout expires, the timeout period is extended by acdirmin
seconds.

For
a directory that rarely changes or that is owned and modified by
only one user, like a user's home directory, you can decrease
the load on your network by setting acdirmin=60
or higher.

acregmax=n

(default=60)

The
maximum number of seconds a file's attributes are cached
on the NFS client. When this timeout period expires, the client
flushes its attribute cache, and if the attributes have changed,
the client sends them to the NFS server.

For
a file that rarely changes or that is owned and modified by only
one user, like a file in a user's home directory, you can
decrease the load on your network by setting acregmax=120
or higher.

acregmin=n

(default=3)

The
minimum number of seconds a file's attributes are cached
on the NFS client. If the file is modified before this timeout expires,
the timeout period is extended by acregmin
seconds.

For
a file that rarely changes or that is owned and modified by only
one user, like a file in a user's home directory, you can
decrease the load on your network by setting acdirmin=30
or higher.

actimeo=n

(no
default)

Setting
actimeo
to n


seconds is equivalent to setting acdirmax
,
acdirmin
, acregmax
,
and acregmin
to n


seconds.

Set
actimeo=1
or
actimeo=3
for
a directory that is used and modified frequently by many NFS clients.
This ensures that the file and directory attributes are kept reasonably
up to date, even if they are changed frequently from various client
locations.

Set actimeo=120
or higher for a directory that rarely or never changes.

If
you set the actimeo
value, do not set the acdirmax
,
acdirmin
, acregmax
,
or acregmin
values.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.