Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Heres my set up: One NFS Server machine, two NFS client machines.

The client machines write files to the NFS mount, but occasionally, the files don't appear on the NFS Server machine or other client machines.....

I'm absolutely stumped on this one...any help would be greatly appreciated!

share|improve this question

1 Answer 1

Don't immediately appear or don't appear for some time?

NFS will by default perform a level of caching of directory and file contents at the kernel level of the system. If machine one updates a file and machine two has still got a copy of the file in cache, then if machine two attempts to access the file then it may not see the newer version of the file until its cache expires.

Check the man page for nfs for the following parameters:

   acregmin=n     The minimum time in seconds that attributes of a  regu-
                  lar  file  should  be  cached  before  requesting fresh
                  information from a server.  The default is 3 seconds.

   acregmax=n     The maximum time in seconds that attributes of a  regu-
                  lar file can be cached before requesting fresh informa-
                  tion from a server.  The default is 60 seconds.

   acdirmin=n     The minimum time in seconds that attributes of a direc-
                  tory  should be cached before requesting fresh informa-
                  tion from a server.  The default is 30 seconds.

   acdirmax=n     The maximum time in seconds that attributes of a direc-
                  tory  can be cached before requesting fresh information
                  from a server.  The default is 60 seconds.

   actimeo=n      Using actimeo sets all of acregmin, acregmax, acdirmin,
                  and  acdirmax  to  the same value.  There is no default
                  value.

   noac           Disable all forms of attribute caching entirely.   This
                  extracts  a  significant  performance  penalty  but  it
                  allows two different  NFS  clients  to  get  reasonable
                  results  when  both  clients  are actively writing to a
                  common export on the server.
share|improve this answer
    
+1. I've had to use noac on a pair of servers that both read/write to the same NFS mount relatively close to each other. Without it, they simply might not see a file that had recently been created. –  Christopher Karel Feb 18 '10 at 16:18
    
If the NFS server is a NetApp filer sharing to Linux boxes your performance will be abysmal unless noac is disabled (i.e. turn off the absence of attribute caching :-)) This is because the NFS client will be requesting every attribute from the NFS server for every stat() call on every file and/or directory. The CPU on the NFS server then ends up going through the roof. The options I typically use to get reasonably good performance (but not immediate updates) is: rw,tcp,rsize=16384,wsize=16384,hard,nointr –  DaveG Feb 18 '10 at 16:27
    
You were right on the money with this response, it was simply a caching issue. DaveG is on point with his suggestion as well, but others will find that they should customize to rsize and wsize to their needs. Thanks for your insight. –  user35307 Feb 22 '10 at 18:20
1  
Would be useful for you to accept the answer then :-) –  DaveG Jul 25 at 14:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.