Article View: news.software.nntp
Article #8789Re: NFS V3 problem with readdir(3C)
From: Ray W. Hiltbrand
Date: Tue, 25 Jun 1996 00:00
Date: Tue, 25 Jun 1996 00:00
124 lines
5543 bytes
5543 bytes
Also a question on your runs? After you run your test
program the first time do you see a speed increase for
v3 compared to the first run? A USENIX paper[PAW94] I just read
talked about the use of the READDIRPLUS function of NFS v3.
One of the pitfall it noted was that after the first readdirplus
call most info should then be in the clients cache so a readdir
would be more efficient.
Michael is the readdir system call setup to take advantage of
a client side cache such that it would not slow down access
once the first readdirplus was made to the server?
[PAW94] Brian Pawlowski, Chet Juszczak, Peter Staubach, Carl Smith,
Diane Lebel, and David Hitz."NFS Version 3 Design and Implementation"
In USENIX Summer 1994 Technical Conference, page 137-152, June 1994
Michael R. Eisler wrote:
>
> In article <4qmr2b$64s@nntpa.cb.lucent.com>,
> Tim Thompson <tgt@pongo.cb.att.com> wrote:
> > I've got a cluster of Sun Sparc 10's and 20's, all running Solaris 2.5.1
> > (NOT 2.5). Via a private NFS network (10Base-T), /var/spool/news is shared
> > amongst them. We're using NFS to separate "feeding" functionality from
> > "reading" functionality. It works well for us; well, it works well for
> > us provided we don't use NFS V3.
> >
> > Part of the reason we went to Solaris 2.5 (and then 2.5.1 due to a bug
> > in 2.5 where some sort of inode cache would exhaust all kernel memory)
> > was because it was rumored that NFS V3 would provide us with much
> > better performance than V2. However, it appears that readdir(3C) is
> > *much* slower in a V3 environment than in V2.
> >
> > On our test machine, I've put the following entries in /etc/vfstab:
> >
> > machine:/var/spool/news - /V2 nfs - yes vers=2
> > machine:/var/spool/news - /V3 nfs - yes vers=3
> >
> > I've created the directories /V2 and /V3, and then mounted the file
> > systems:
> >
> > $ mount | grep V
> >
> > /V2 on machine:/var/spool/news vers=2/remote on Mon Jun 24 13:28:04 1996
> > /V3 on machine:/var/spool/news vers=3/remote on Mon Jun 24 13:28:06 1996
> >
> > Then I run this short test program (included below). Notice the time to
> > look at things on the file system mounted using NFS Version 2 is *much*
> > less than the time on the file system mounted using NFS version 3.
> >
> > $ ./testprog /V2/alt/test
> > START TIME: Mon Jun 24 15:20:58 1996
> >
> > END TIME: Mon Jun 24 15:21:00 1996
> >
> > $ ./testprog /V3/alt/test
> > START TIME: Mon Jun 24 15:21:04 1996
> >
> > END TIME: Mon Jun 24 15:27:30 1996
> >
> > Granted, I've only shown a sample of one here, but the results are
> > consistent: the time to run on the V3 file system is always considerable
> > more than on the V2 file system.
> >
> > It looks like the readdir(3C) system call is taking an inordinate amount
> > of time when NFS V3 is being used.
> >
> > Any/all suggestions are most welcome.
>
> Solaris 2.5 clients use the NFS3_READDIRPLUS procedure which will also return
> attributes withe each directory entry. Programs like find, ls -l,
> etc. are supposed to be faster. It would be itneresting to seehow your
> test program performans if you stat() each entry in the directory.
> >
> > Tim Thompson
> > tgt@lucent.com
> >
> >P.S. I've got a call into Sun support on this problem.
> >
> >========================> cut here <=======================
> >#include <dirent.h>
> >
> >main(argc,argv)
> >int argc;
> >char *argv[];
> >{
> > register struct dirent *ep;
> > register DIR *dp;
> > long now;
> >
> > dp = opendir(argv[1]);
> >
> > if (dp == NULL) {
> > printf("No such directory!\n");
> > exit(-1);
> > }
> >
> > now = time(0);
> > printf("START TIME: %s\n", ctime(&now));
> > while ((ep = readdir(dp)) != NULL)
> > ;
> >
> > now = time(0);
> > printf("END TIME: %s\n", ctime(&now));
> >}
> >--
> >This is an all-natural posting, containing | Tim Thompson
> >no artificial colorings, flavorings, or | Netnews Service Manager/Engineer
> >preservatives. | Lucent Technologies
> > | tgt@lucent.com
>
> --
> -Mike Eisler NFS group
> mre@Eng.Sun.Com SunSoft
--
Ray W. Hiltbrand Ray.W.Hiltbrand@eng.auburn.edu
Engineering Network Services
Auburn University http://www.eng.auburn.edu/~rayh/rayh.html
If it doesn't do what you want, subclass and override.
Technical Details
Message-ID:
<31D062A2.7BFF@eng.auburn.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<4qmr2b$64s@nntpa.cb.lucent.com> <4qn5r9$3hb@engnews2.Eng.Sun.COM>Show Full Headers
Complete Article Headers
Message-ID: <31D062A2.7BFF@eng.auburn.edu> Subject: Re: NFS V3 problem with readdir(3C) Date: Tue, 25 Jun 1996 00:00:00 +0000 From: "Ray W. Hiltbrand" <Ray.W.Hiltbrand@eng.auburn.edu> References: <4qmr2b$64s@nntpa.cb.lucent.com> <4qn5r9$3hb@engnews2.Eng.Sun.COM> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 162167752 Sender: usenet@mail.auburn.edu (Usenet Administrator) Content-type: text/plain; charset=us-ascii Organization: College of Engineering Auburn University Mime-version: 1.0 Newsgroups: comp.unix.solaris,news.software.nntp X-mailer: Mozilla 3.0b4Gold (X11; I; SunOS 5.5 sun4m)