1

We are having a weird issue where file creation/removal from a NFS client takes a very long time to propagate out to the other client(s).

Mount options we have on the clients are:

defaults,rsize=32768,wsize=32768,intr,noatime,cto

The export has:

*(rw,sync,no_root_squash,no_wdelay)

We verify this by on one client doing:

watch -n0.1 stat foofile

And on another client we touch foofile (or rm it). Modifications take 1+ seconds to propagate out.

cto and no_wdelay are options we've just recently added to see if they solve the issue (they dont). What else can we look at?

c0dem4gnetic
  • 165
  • 1
  • 7
  • 1
    disabling lookupcache setting `lookupcache=none` mount option might be of interest (see http://serverfault.com/q/380303/117245) – Dima Chubarov Dec 03 '13 at 12:31
  • try with mount options acdirmin= and acdirmax= to control times client caches directory attributes. – kofemann Dec 04 '13 at 20:25

2 Answers2

5

I'm not going to answer your question directly.

NFS clients are not guaranteed to see updates very fast. Yes, you can tune parameters to control the delay but the result will be worse caching (and therefore terrible performance) on the clients.

Usually when I find myself needing NFS clients to see changes faster I take a step back and ask, "ok, what am I really trying to achieve here?" Usually I'll realize there is some higher level of abstraction that lets me solve the same problem a very different way. For example, sometimes I realize I'm trying to use NFS files as a poor-man's RPC or lock mechanism. There are much better ways to do either of those things.

NFS is good for a single client accessing a particular directory. Outside of that if you have a problem and are going to fix it with NFS, then you have two problems.

I love NFS but it is limited in where I try to use it.

TomOnTime
  • 7,945
  • 6
  • 32
  • 52
1

It is by no means certain to be your problem, but I've sometimes found coherency issues with NFS where the clients and server do not all have rigidly synced clocks. Are all systems concerned sync'ed to NTP?

MadHatter
  • 79,770
  • 20
  • 184
  • 232