We have been doing various things to investigate poor performance of
our Digital NFS servers in comparison to Linux-based fileservers. We
believe that one reason that Linux is so much faster is that it does
asynchronous writes (doubtless in violation of the NFS specification).
I looked at the DU tuning guide, and it suggested that write
performance would be much improved if we switched from NFS V2 to NFS
V3 - the writes would be not only asynchronous but also safe.
So we tried it, and immediately noticed a very severe performance
degradation in reading large directories. Operations that were
previously taking a fraction of a second were taking half a minute or
more.
We analysed the network traffic with tcpdump, and noticed two things:
1. The "getdirentries" NFS call was running very slowly.
2. It was returning fewer directory entries per call in V3 by
comparison with V2.
We conjecture that what is happening is that the server is getting the
attributes for each directory entry, and returning them in the reply
for the client to cache. We have no proof of this, but it fits with
the observations and our understanding of the "improvements" in NFS
V3.
The anticipatory attribute cacheing is all very well if the client was
intending to "stat" all the entries anyway, but often this is not the
case. The client may only be interested in a small subset of entries
that match a pattern, or in entries that are new since it last looked
at the directory. The particular application which is made
unacceptably slow for us by this effect is exmh (an X interface to the
MH mail user agent).
So, to the questions:
1. Can anybody confirm our diagnosis?
2. Is there anything we can do about it?
3. Are there any other ways to tackle the original problem? Ideally
we would like to be able to choose for each filesystem whether writes
are to be synchronous or not. For some filesystems, reliability is
important; for others, speed is of the essence.
--
Martyn Johnson maj_at_cl.cam.ac.uk
University of Cambridge Computer Lab
Cambridge UK
Received on Fri May 29 1998 - 19:52:27 NZST