On Fri, 26 Apr 2002, Brian Candler wrote:
> I have been tracing some performance problems on diskless systems. In > particular, the following test program: > > perl -e 'for ($i=0;$i<1000;$i++) { open F,"</bin/rm"; $x=<F>; close F;}' > > generates 1000 'access' transactions, and hence an exchange of 2000 UDP > packets, just from repeatedly opening the same file. Because access control is performed on the server with NFSv3, not the client, you have to go to the server when you open a file. The attribute cache caches information for stat(), not for evaluation during open(). Although open() might stat the file (vop_getattr()), that's really not the same thing. Try instead a stat() rather than open() and see how the results change in your performance test. Note that an important reason to invoke the NFS RPC for access during open() is that the client may not understand the protection semantics of the server. For example, the server might support ACLs, but the client might not. Or the server might support another access control model of another sort. The return from GETATTR is generally just used for file information rendering as of NFSv3, not actual evaluation. If you cache data for open()'s, you risk problems during a revocation operation. Also, you potentially allow opening files that will become ESTALE, etc. NFSv2/3 isn't really intended to do this sort of caching. You might want to investigate AFS, since AFS tends to perform operations on close() rather than open() once a file is in the cache (and has a "callback" model to invalidate cached files on meta-data changes of this sort). Robert N M Watson FreeBSD Core Team, TrustedBSD Project [EMAIL PROTECTED] NAI Labs, Safeport Network Services To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message