cvs commit: src/sys/vfs/nfs nfs_vnops.c
Matthew Dillon
dillon at crater.dragonflybsd.org
Thu Apr 8 15:32:39 PDT 2004
dillon 2004/04/08 15:32:15 PDT
DragonFly src repository
Modified files:
sys/vfs/nfs nfs_vnops.c
Log:
Introduce negative (ENOENT) caching for NFS. Before this, an attempt to
lookup a non-existant path would ALWAYS result in packet traffic. That is,
NFS was only attribute-caching successful lookups, not failed lookups,
and was not making use of the VFS cache facility virtually at all. This new
features complements the existing attribute cachign feature.
Add a sysctl, vfs.nfs.neg_cache_timeout, which controls the timeout for
negatively cached lookups. The default is 3 seconds. You can set this
sysctl to 0 to recover the old non-negative-caching behavior.
This makes a HUGE difference for programs which search nfs directories, such
as compilers (the header file search path), make, and a few other utilities.
NFS packet traffic can be reduced upwards of 90%. For example, with /usr/src
mounted via NFS, building libc a second time without negative caching
generates 66000 packets of NFS traffic in each direction, building libc
a second time with negative caching enabled generates 9500 packets worth
of NFS traffic, in EACH DIRECTION. While it is true that negative lookups
are cached on the NFS server, the huge reduction in network traffic and
equivalent reduction in synchronous read latencies result in radically
reduced overheads across the board for operations which generate a lot of
negative hits.
A buildworld test with the default 3 second negative caching timeout went
from 2265 seconds to 1900 seconds.
Revision Changes Path
1.20 +44 -4 src/sys/vfs/nfs/nfs_vnops.c
http://www.dragonflybsd.org/cvsweb/src/sys/vfs/nfs/nfs_vnops.c.diff?r1=1.19&r2=1.20&f=h
More information about the Commits
mailing list