nfs delay causing broken files

Rick Macklem rmacklem at uoguelph.ca
Fri Feb 6 09:22:33 PST 2009



On Fri, 6 Feb 2009, Rick Macklem wrote:

[stuff snipped]
>
> If the recent writes need to be visible on other clients (and not just the
> NFS server), you will also have to bypass the client side caching for
> readers. This can be done by setting nfs_directio_enable to non-zero
> using sysctl and opening the files with O_DIRECT. (I think setting
> acregmax=0 as a mount option should achieve the same result, if you can't
> add O_DIRECT to the apps.) Again, a big performance hit, but...
>
I know it's weird to reply to my own post, but I realized I should clarify
that setting acregmax=0 will only achieve this approximately, based on
the clock resolution used for the file's modify time. Setting acregmax=0
should disable client side attribute caching, such that the client always
does a Getattr against the server. Then, if the mtime attribute for the
file has changed since the client cached data, it will be purged. As such,
this only works when the mtime has changed and that will be based upon
clock resolution (and if the mtime got saved on the server's disk, for the
case where the server has crashed/rebooted).

Have a good weekend, rick



More information about the freebsd-fs mailing list