Slightly OT, as it isn't directly netapp related, but does anyone know of a way to test if a file exists in Solaris besides a full-fledged stat() or attempting an open? I'm looking through web server stats, and I noticed I'm spending most of my nfs time doing getattrs, which I presume map back to stats that (mostly) test for existance.
It strikes me that a getattr is rather painful in contrast to a lookup, but I have no idea how (or if) if the lesser can be forced.
I've toyed with the idea of increasing actimeo and friends up, but am not sure of all the caveats of doing so (namely, are negative entries cached? I'm thinking along the lines of DNS's NXDOMAIN cachine semantics .. false positives would be OK, but the false negatives would be baaad).
Ideas?
Thanks.
..kg..
It strikes me that a getattr is rather painful in contrast to a lookup,
I'm not sure I'd assume that.
A GETATTR takes, as an argument, a file handle; the NFS server uses that to find the file, and then translates the file's attributes from its internal form to the NFS over-the-wire form.
A LOOKUP takes, as arguments, a file handle and a file name; the NFS server uses the file handle to find the directory, and then looks up the file name in the directory. I suspect that on most UNIX NFS servers, and on ONTAP, doing a directory lookup will be more expensive than translating file attributes - and both of them require looking up a file by its file handle.
I've toyed with the idea of increasing actimeo and friends up, but am not sure of all the caveats of doing so (namely, are negative entries cached?
It's been a while since I've seen SunOS NFS client code, and that was SunOS 4.x rather than 5.x, but, as I remember, the attribute cache caches only attributes the machine found - it doesn't cache errors you'd get from a GETATTR, which would probably be ESTALE errors.