Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!xanadu!llustig!objy!prefect!peter From: peter@prefect.Berkeley.EDU (Peter Moore) Newsgroups: comp.protocols.nfs Subject: Buffering in biod and nfsd. Message-ID: <1990Dec15.071319.16674@objy.com> Date: 15 Dec 90 07:13:19 GMT Sender: news@objy.com Reply-To: peter@objy.com Organization: Objectivity Inc. Lines: 60 I have some questions on cacheing and synchronization that I hope some of you NFS implementors can answer. I realize that the answers to these questions can be very implementation specific, but I am interested in almost any systems answer to these questions (but in particular Ultrix, SunOS and AIX3.1) The Unix implementations I have seen use the daemons biod and nfsd to do the actual client and server (resp.) NFS calls. (I understand that at least biod is optional, but lets assume that daemons are used at both ends). The question (actually worry) is how much buffering is done in these daemons and whether that buffering can be controlled. In particular: biod: I have seen biod described as read-ahead and write-behind. Which implies it both caches writes (in the sense that it returns before the write is actually done) and it actually reads more blocks than requested, in anticipation of the additional blocks being used in a future calls. So: a) Does it return before the actual NFS-write is complete? b) Again, if a) is true, is there any way for the user to find that the write failed? c) If so, is there any way a user process can assure that a particular block or all of its writes in have been written yet? In particular does fsync work or is it (as I have heard) a no-op? d) Does biod actually read-ahead? e) If so, how does it decide when to flush the cached data and actually re-read the data? f) Is there any way a user process can affect that cacheing? nfsd: a) Does the nfsd the write back directly do disk, or maintain a personal cache? (My understanding is that modulo WRITECACHE, it definitely does not, in fact it even flushes the OS cache). b) If (heaven forbid and presto-serve not installed) it does cache writes, can this be flushed under user control? c) Does it do any read-ahead/read-cacheing (I would certainly hope it wouldn't) d) If (again, heaven forbid) it does do read-cacheing, can that be flushed under user control? My guess is that nfsd doesn't do any cacheing (except for the implicit cacheing of the OS buffer pool), biod does write-behind and read ahead, but there is no way to control any of it at the user process level. But I hope this is not true, since it make NFS mounted file systems pure poison for any one doing distributed database work. Most, if not all, of these problems can be eliminated by directly connecting to the nfsd, and do the RPC calls directly, but that is fairly drastic. Anyway, thanks for whatever help you can give me, Peter Moore