NFS - Files on client are not appearing on server

6,589

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:
6,589

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    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!

  • Christopher Karel
    Christopher Karel over 14 years
    +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.
  • DaveG
    DaveG over 14 years
    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
  • A.B. User
    A.B. User over 14 years
    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.
  • DaveG
    DaveG almost 10 years
    Would be useful for you to accept the answer then :-)