home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / sun / admin / 9390 < prev    next >
Encoding:
Text File  |  1992-12-13  |  6.4 KB  |  188 lines

  1. Newsgroups: comp.sys.sun.admin
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!dsinc!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!sics.se!eua.ericsson.se!erix.ericsson.se!per
  3. From: per@erix.ericsson.se (Per Hedeland)
  4. Subject: Re: Slave NIS Server Reboots -> Client Hangs?
  5. Message-ID: <1992Dec13.193706.12275@eua.ericsson.se>
  6. Sender: news@eua.ericsson.se
  7. Nntp-Posting-Host: super.eua.ericsson.se
  8. Nntp-Posting-User: per
  9. Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
  10. References: <derosa.724088276@mica> <k231Hs&vab@atlantis.psu.edu>
  11. Date: Sun, 13 Dec 1992 19:37:06 GMT
  12. Lines: 174
  13.  
  14. In article <k231Hs&vab@atlantis.psu.edu> barr@pop.psu.edu (David Barr) writes:
  15. >    Doncha just love NIS?  *sigh*.  There is a patch which
  16. >"fixes" it, but at a significant performance penalty.  Here's part
  17. >of the README for patch 100342-02:
  18. [deleted]
  19. >    Personally, I haven't applied this patch, but I'm tempted
  20. >to.  I'm sick and tired of NIS just going out the window whenever
  21. >an NIS client reboots.  Somehow I think Sun could have thought up
  22. >a smarter fix to the problem than this.
  23.  
  24. They certainly could have, and fortunately for us Casper Dik did - I've
  25. been running the patch below for 8 months now on SunOS 4.1.1 and 4.1.3,
  26. works great - I recently added it to the static libc.a too, since emacs
  27. (statically linked because of the need to do dump/undump) didn't benefit
  28. otherwise. I've also found that some automounting that would previously
  29. occasionally hang for a long time never does so anymore.
  30.  
  31. --Per Hedeland
  32. per@erix.ericsson.se  or
  33. per%erix.ericsson.se@sunic.sunet.se  or
  34. ...uunet!erix.ericsson.se!per
  35.  
  36.  
  37. From: casper@fwi.uva.nl (Casper H.S. Dik)
  38. Newsgroups: comp.sys.sun.misc,comp.sys.sun.admin
  39. Subject: FIX for slow rebinding of NIS.
  40. Summary: a small change in libc makes life with NIS a lot easier.
  41. Message-ID: <1992Jan17.173905.11727@fwi.uva.nl>
  42. Date: 17 Jan 92 17:39:05 GMT
  43. Sender: news@fwi.uva.nl
  44. Organization: FWI, University of Amsterdam
  45. Lines: 138
  46. Nntp-Posting-Host: halo.fwi.uva.nl
  47.  
  48. Have you been plagued by long waits when your NIS server is rebooted?
  49. READ ON!
  50.  
  51. Sun has a patch, but the README says:
  52.  
  53. ********************* WARNING ******************************
  54.  
  55.   This is a new version of ypbind that never uses the NIS 
  56.   binding file to cache the servers binding. This will have
  57.   the effect of fixing the current symptom. However, it might
  58.   degrade the overall performance of the system when the 
  59.   server is available. This is most likely to happen on an
  60.   overloaded server, which will cause the network to produce
  61.   a broadcast storm. 
  62.  
  63. *************************************************************
  64.  
  65. Therefor, I have produced another fix.
  66.  
  67. o What goes wrong.
  68.  
  69. When the NIS server is rebooted, ypserv will obtain different ports
  70. to listen for RPC requests. All clients will continue to use the old
  71. binding they obtained earlier. The NIS server will send ICMP dst unreachable
  72. messages for the RPC requests that arrive at the old port. These ICMPs
  73. are dropped on the floor and the client code will continue sending the
  74. requests until the timer has expired. The small fix at the end of this
  75. message will pick up these ICMP messages and deliver them to the RPC layer.
  76.  
  77. o Before and after.
  78.  
  79. I've tested this on some machines and this is the result:
  80.  
  81.     (kill and restart ypserv on the server)
  82.  
  83. original% time ypmatch user passwd
  84. user:....
  85. 0.040u 0.090s 2:35.64 0.0% 0+126k 0+0io 0pf+0w (155 seconds elapsed time)
  86.  
  87. fixedhost% time ypmatch user passwd
  88. user:....
  89. 0.050u 0.050s 0:10.20 0.9% 0+136k 0+0io 0pf+0w (10 seconds elapsed time)
  90.  
  91. Rebinding is almost instantaneous.
  92.  
  93. o Other benefits.
  94.     RPC calls that use UDP as transport will no longer time out but
  95.     will abort much sooner. (E.g., the remote host is unreachable or
  96.     111/udp is filtered by an intermediate router)
  97.  
  98.  
  99. o How to apply the fix.
  100.  
  101.     - obtain clnt_udp.c from SUNRPC 4.0
  102.       SUNRPC 4.0 is available at numerous FTP sites, e.g.,
  103.       ftp.uu.net:/systems/sun/sextape/rpc4.0/rpc/clnt_udp.c.Z
  104.  
  105.     - apply the context diff at the end of this messages.
  106.       
  107.     - compile:
  108.         cc -O4 -c -pic clnt_udp.c
  109.       install the obtained clnt_udp.o in the shared library.
  110.  
  111.       See /usr/lib/shlib.etc/README for details. If you run SunOS 4.1.2,
  112.       you must change the following in shlib.etc/Makefile (twice): 
  113.  
  114.        ld -assert pure-text `${OBJSORT} lorder-sparc tmp`
  115.       to
  116.        ld -assert pure-text `${OBJSORT} lorder-sparc tmp` -ldl
  117.  
  118.      - test the new shared library.
  119.        % setenv LD_LIBRARY_PATH <where the library is>
  120.        % ldd /usr/etc/rpcinfo 
  121.         -lc.1 => <the new library>
  122.         -ldl.1 => ...        (with SunOS 4.1.2)
  123.        % /usr/etc/rpcinfo -u <host> ypserv
  124.        if <host> is unreachable, or if host does not run the portmapper
  125.        the (immediate) response should be:
  126.  
  127.        rpcinfo: RPC: Port mapper failure - RPC: Unable to receive
  128.        program 100004 is not available
  129.  
  130.        
  131.  
  132. Casper
  133.  
  134. *** clnt_udp.c.orig    Thu Mar 14 12:52:12 1991
  135. --- clnt_udp.c    Fri Jan 17 17:55:39 1992
  136. ***************
  137. *** 27,32 ****
  138. --- 27,37 ----
  139.    * 2550 Garcia Avenue
  140.    * Mountain View, California  94043
  141.    */
  142. + /*
  143. +  * Casper Dik (casper@fwi.uva.nl)
  144. +  * changed sendto in clntudp_call to connect/send.
  145. +  * This enables the caller to receive ICMP messages as Host or port unreachable
  146. +  */
  147.   #if !defined(lint) && defined(SCCSIDS)
  148.   static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
  149.   #endif
  150. ***************
  151. *** 256,265 ****
  152.           return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
  153.       outlen = (int)XDR_GETPOS(xdrs);
  154.   
  155.   send_again:
  156. !     if (sendto(cu->cu_sock, cu->cu_outbuf, outlen, 0,
  157. !         (struct sockaddr *)&(cu->cu_raddr), cu->cu_rlen)
  158. !         != outlen) {
  159.           cu->cu_error.re_errno = errno;
  160.           return (cu->cu_error.re_status = RPC_CANTSEND);
  161.       }
  162. --- 261,280 ----
  163.           return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
  164.       outlen = (int)XDR_GETPOS(xdrs);
  165.   
  166. +     /*
  167. +      * Give error (ECONNREFUSED/EHOSTUNREACH) instead of timeout.
  168. +      * Gives much faster NIS rebinding.
  169. +      * Errors are not detected here, but in the recvfrom()
  170. +      * following the select().
  171. +      */
  172. +     if (connect(cu->cu_sock, (struct sockaddr *)(&cu->cu_raddr),
  173. +         cu->cu_rlen) != 0) {
  174. +         cu->cu_error.re_errno = errno;
  175. +         return (cu->cu_error.re_status = RPC_CANTSEND);
  176. +     }
  177.   send_again:
  178. !     if (send(cu->cu_sock, cu->cu_outbuf, outlen, 0) != outlen) {
  179.           cu->cu_error.re_errno = errno;
  180.           return (cu->cu_error.re_status = RPC_CANTSEND);
  181.       }
  182. -- 
  183.                         |    Casper H.S. Dik
  184.                         |    casper@fwi.uva.nl
  185.  
  186.  
  187.