On Sep 20, 2007, at 7:40 PM, Matty wrote: > On 9/20/07, Spencer Shepler <Spencer.Shepler at sun.com> wrote: >> >> On Sep 20, 2007, at 6:58 PM, Matty wrote: >> >>> Howdy, >>> >>> I have a question for the NFS gurus on the list. We have a number of >>> Solaris and Linux NFS clients that need to know when a file on a >>> server changes. Currently they are issuing stat() calls to determine >>> this, which means we are issuing thousands of NFS operations to >>> determine if a given file has changed. Is anyone aware of a method >>> that would allow the server to notify the client when a file changes >>> (i.e., is there a file events notification facility for NFS)? I >>> perused the NFSv4 RFC to see if a file event notification facility >>> existed, but I didn't see anything that would do what I wanted (If I >>> missed it, please let me know. I will wander off to read). >> >> NFSv4.1's directory delegations and notifications is what you would >> like to have. Directory delegations will take care of the first >> order effect of having the client poll via GETATTR for changes. >> If there are specific files of interest then notifications can >> be more targeted. Although notifications are asynchronous, they >> will not be "any worse" than the current polling mechanism in >> regards to timeliness but will significantly reduce overhead >> throughout. > > Sweet! How do you notify the server that a file or directory needs to > be placed on the notification list?
It is done at the request of the NFSv4.1 client. It can ask for a directory delegation and then notifications within that directory for a few different events. The server may provide them (it has to support the feature to begin with. :-)) and then have them available. It may be the server does not want to have too many notifications instantiated because of the overhead as one example. > Any idea when a prototype will be > available for us to play with? For OpenSolaris, I don't. We have been focused on the pNFS work but directory delegations will likely be high on the list after that given the potential for performance improvements. For other implementations, I haven't heard of anything. I expect that activity will pick up soon since the NFSv4.1 protocol specification is coming to a close over the next 2-3 months. Spencer