From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Parkin Frank - fparki Newsgroups: gmane.os.tru64.managers Subject: NFS Best Practices Date: Wed, 18 Jun 2003 14:13:20 +0100 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: main.gmane.org 1055941969 28235 80.91.224.249 (18 Jun 2003 13:12:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 18 Jun 2003 13:12:49 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Wed Jun 18 15:12:45 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 19Sck0-0007L1-00 for ; Wed, 18 Jun 2003 15:12:44 +0200 Original-Received: (qmail 15992 invoked by uid 5); 18 Jun 2003 13:12:34 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 15983 invoked by uid 49493); 18 Jun 2003 13:12:34 -0000 Original-Received: from fparki@acxiom.co.uk by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-1.9/5.0):. Processed in 0.571448 secs); 18 Jun 2003 13:12:34 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 18 Jun 2003 13:12:33 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HGO004W7I0WMQ@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 18 Jun 2003 09:12:32 -0400 (EDT) Original-Received: from aerynsun.acxiom.com (aerynsun.acxiom.com [198.160.100.121]) by emroute1.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HGO00H5SI0UT4@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 18 Jun 2003 09:12:31 -0400 (EDT) Original-Received: from relay2.conway.acxiom.com (unverified) by aerynsun.acxiom.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Wed, 18 Jun 2003 08:12:25 -0500 Original-Received: from srvlon20.uk.acxiom.com (unverified [10.150.100.51]) by relay2.conway.acxiom.com (Content Technologies SMTPRS 4.3.10) with ESMTP id for ; Wed, 18 Jun 2003 08:12:25 -0500 Original-Received: by srvlon20.uk.acxiom.com with Internet Mail Service (5.5.2653.19) id <2CJ25TTB>; Wed, 18 Jun 2003 14:05:19 +0100 Content-return: allowed Original-To: "'tru64-unix-managers@ornl.gov'" X-Mailer: Internet Mail Service (5.5.2653.19) Xref: main.gmane.org gmane.os.tru64.managers:4584 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:4584 We are frequently experiencing problems with NFS. Users file transfers time-out and we see messages like the following: Jun 18 12:22:34 server1 vmunix: NFS3 RFS3_WRITE failed for server server2: RPC: Timed out Jun 18 12:22:34 server1 vmunix: NFS3 write error 60 on host server2 Jun 18 13:45:49 server1 vmunix: NFS3 server server2 not responding still trying We have numerous Alpha servers (v5.1a PK4) each of which are acting as NFS client and server with numerous mounts (majority use gigabit Ethernet). The current nfsd and nfsiod settings are: root 156305 1 0.0 12:38:33 ?? 0:00.01 /usr/sbin/nfsiod 24 root 156320 1 0.0 12:38:33 ?? 0:00.01 /usr/sbin/nfsd -t32 -u32 The usual mounting options are: server1:/dir1 /dir2 nfs rw,bg,soft,tcp Has anyone experienced similar problems? We have applied a gigabit Ethernet patch from HP but this hasn't improved the situation. Are there any NFS best practice documents out there? I have also stumbled across the following extract from an old thread (1995?) on NFS problems (see below). Is this information still valid such that multiple NFS mounts from different servers should be mounted in the following way... /nfs/server1/dir1 /nfs/server1/dir2 /nfs/server2/dir1 etc. Many thanks Frank The prevailing wisdom, summarised by Bernhard Schneck: Thou Shalt Not Mounteth into the root directory. but more exactly: Rule 1. The parent directory of the nfs mount pt. shall not be root. Rule 2. An nfs mount pt. shall not share its parent directory with another nfs mount pt. -passable exception: it the nfs mounts are from the same nfs server, it probably will not be problematic. The most complete explanation and solution are from Paul David Fardy below, but I also include selected others for relevent insite and comment: ===== From: Paul David Fardy >> This is a common problem with NFS. Many programs (the best example being /bin/pwd) search up the directory to find the full pathname for the current directory. On the way up, a program can encounter a remote filesystem root directory and hang if the host is unavailable. The process often gets into an uninterruptable state. Take an example with 3 systems--Athos, Porthos, and Aramis--sharing user files. Athos mounts the following file systems. /u1@xxxxxxx > on /nfs/u1 /u2@xxxxxxx on /nfs/u2 /u3@xxxxxx > on /nfs/u3 When a user Bob runs "pwd" from /nfs/u1/bob, pwd does the following search. A. i-node = stat(".") # I don't my name, but I do know my number. B. chdir .. and scan for i-node # Directory must be in parent somewhere C. found "bob" matching i-node # I now know my path ends in "bob", D. i-node = stat(".") # but I still don't know my parent's name. E. chdir .. and scan for i-node # F. found "u1" matching i-node # I now know my path ends in "u1/bob". G. i-node = stat(".") # H. chdir .. and scan for i-node # I. found "nfs" matching i-node # I now know my path ends in "nfs/u1/bob" G. i-node = stat(".") # H. chdir .., scan for i-node # I. found "." matching i-node # Must be the root directory, we're done. When it works, pwd prints "/nfs/u1/bob". But NFS hanging can occur if Aramis is unreachable. If we look back at those scans with full knowledge (as opposed to pwd's view), we know the following. Step A stats /nfs/u1/bob Step B scans /nfs/u1 Step E scans /nfs Step H scans / The problem is that Step E scans /nfs and in the process could attempt to access /nfs/u3 (the ordering of the /nfs directory is based on timing). If Aramis is unreachable, then pwd will hang. The Solution: (that dreaded word) Segregation There are two models that clear this NFS problem. The one I suggested earlier separates every mount point. /u1@xxxxxxx > on /nfs/u1/nfs /u2@xxxxxxx > on /nfs/u2/nfs /u3@xxxxxx > on /nfs/u3/nfs In this model, no two NFS mount points share a common parent. Another model we've used in the past separates mount points based on the serving host. /u1@xxxxxxx > on /nfs/porthos/u1 /u2@xxxxxxx > on /nfs/porthos/u2 /u3@xxxxxx > on /nfs/aramis/u3 In this model, u1 and u2 share a common parent, but they're both served from the same host. If u2 were going to hang, then it's not likely that u1 is reachable in the first place. In either scheme, a program like pwd run from any network filesystem would have to go up to /nfs then down a directory to encounter another remote file system. Very few programs do this; no program should. I prefer the first model because a) it generates shorter paths (df is less likely to wrap and more likely to fit on a screen) and b) the second model is redundant (when you move a disk you have to change the mount directories and the symbolic links that hide the mount points along with the entry in /etc/fstab). ********************************************************************** The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please re-send this communication to the sender and delete the original message or any copy of it from your computer system. Thank You.