disable NFS client cache

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.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
禁用缓存是一种在开发过程中常用的方法,可以确保在修改代码后能够及时看到更新的效果。通过在浏览器的Network选项中勾选Disable cache,可以禁用浏览器的缓存机制,使得每次加载页面都会重新请求服务器获取最新的内容。这样可以提高开发效率和准确性。\[1\]同时,禁用缓存也可以避免一些错误的数据被缓存导致的问题。在一些实时更新的网站中,禁用缓存是非常重要的,因为缓存可能会导致显示的数据不是最新的。\[2\]在代码中,可以通过设置HTTP请求头的Cache-Control和Pragma字段为no-cache来禁用缓存。另外,在使用Ajax请求时,可以在beforeSend函数中设置请求头的If-Modified-Since和Cache-Control字段为0和no-cache来禁用缓存。\[3\]总之,禁用缓存是一种常用的开发技巧,可以确保开发过程中的准确性和效率。 #### 引用[.reference_title] - *1* [修改代码后,刷新页面没有更新的解决办法。Disable cache禁止缓存](https://blog.csdn.net/weixin_45014721/article/details/127769161)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [js设置浏览器不缓存](https://blog.csdn.net/wepe12/article/details/90229896)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值