NFS and slow links

Jonathan I. Kamens jik at athena.mit.edu
Wed Feb 27 02:18:06 AEST 1991


  (Note: The article to which I am replying was posted separately to the three
newsgroups in my Newsgroups: line; the References: line of this message
indicates the Message-IDs under which it was posted in those newsgroups.)

  It is likely that the reason linking goes slowly when creating an executable
in an NFS filesystem is that the linker has to seek back and forth to various
points in the file while linking.  Because of that, it isn't just a matter of
reading in the sequential blocks of a file or writing out the sequential
blocks of a file -- the same blocks have to be read in over and over again
each time the linker seeks to them.

  A possible work-around to avoid this problem is to create a symbolic link
in the directory in which you are compiling to force the linking to take place
in a local directory like /tmp or /usr/tmp (or just to specify such a
directory when specifying the output file name to the linker), and then mv the
file onto the NFS partition when it's done linking.  You'll probably get a
significant speed improvement that way.

  In fact, I just linked emacs (my emacs sources are on NFS) into a local
file, and then did the same link in the emacs source directory.  The output of
/bin/time from the local link:

      102.9 real        11.1 user        13.6 sys

The output of /bin/time from the NFS link:

      260.4 real        10.7 user        14.6 sys

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.wizards mailing list