freebsd-src/lib/libc
Bill Paul f9dde4e78c Submitted by: Sebastian Strollow
Obtained from: Casper H. Dik (by vay of Usenet)

Small patch to help improve NIS rebinding times (among other things):


>From: casper@fwi.uva.nl (Casper H.S. Dik)
>Newsgroups: comp.sys.sun.misc,comp.sys.sun.admin
>Subject: FIX for slow rebinding of NIS.
>Summary: a small change in libc makes life with NIS a lot easier.
>Message-ID: <1992Jan17.173905.11727@fwi.uva.nl>
>Date: 17 Jan 92 17:39:05 GMT
>Sender: news@fwi.uva.nl
>Organization: FWI, University of Amsterdam
>Lines: 138
>Nntp-Posting-Host: halo.fwi.uva.nl

Have you been plagued by long waits when your NIS server is rebooted?
READ ON!

Sun has a patch, but the README says:

********************* WARNING ******************************

  This is a new version of ypbind that never uses the NIS
  binding file to cache the servers binding. This will have
  the effect of fixing the current symptom. However, it might
  degrade the overall performance of the system when the
  server is available. This is most likely to happen on an
  overloaded server, which will cause the network to produce
  a broadcast storm.

*************************************************************

Therefor, I have produced another fix.

o What goes wrong.

When the NIS server is rebooted, ypserv will obtain different ports
to listen for RPC requests. All clients will continue to use the old
binding they obtained earlier. The NIS server will send ICMP dst unreachable
messages for the RPC requests that arrive at the old port. These ICMPs
are dropped on the floor and the client code will continue sending the
requests until the timer has expired. The small fix at the end of this
message will pick up these ICMP messages and deliver them to the RPC layer.

o Before and after.

I've tested this on some machines and this is the result:

	(kill and restart ypserv on the server)

original% time ypmatch user passwd
user:....
0.040u 0.090s 2:35.64 0.0% 0+126k 0+0io 0pf+0w (155 seconds elapsed time)

fixedhost% time ypmatch user passwd
user:....
0.050u 0.050s 0:10.20 0.9% 0+136k 0+0io 0pf+0w (10 seconds elapsed time)

Rebinding is almost instantaneous.

o Other benefits.
	RPC calls that use UDP as transport will no longer time out but
	will abort much sooner. (E.g., the remote host is unreachable or
	111/udp is filtered by an intermediate router)
1995-04-02 20:05:20 +00:00
..
amd64 First round of changes to clean up the RCSID mess in libc: 1995-01-23 01:30:24 +00:00
compat-43 gethostid.2 is now gethostid.3. Instal the correct one. 1994-08-28 17:08:36 +00:00
db Added the mpool.3 manpage to the installed manpages. It is referred from the 1994-12-11 22:03:05 +00:00
gen Clear IGNPAR in cfmakeraw() instead of set it. 1995-03-29 19:28:35 +00:00
gmon Added support for kernel profiling to mcount.c 1994-09-15 16:00:41 +00:00
i386 First round of changes to clean up the RCSID mess in libc: 1995-01-23 01:30:24 +00:00
locale Update info about LC_COLLATE implementation 1995-03-26 18:57:19 +00:00
net Add ether_addr functions to libc. This seems to be the logical place 1995-04-02 01:31:17 +00:00
nls Fix manpage rule 1995-04-02 19:35:40 +00:00
quad BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
regex First crack at making libc work with the new make macros. It compiles on 1994-08-05 01:19:12 +00:00
rpc Submitted by: Sebastian Strollow 1995-04-02 20:05:20 +00:00
stdio Remove `|| flags & ALT == 0' which was an obscure no-op, not a 1995-03-12 13:53:51 +00:00
stdlib Fix a missing _hash() to prevent namespace pollution with the db/hash routines. 1995-03-28 08:41:02 +00:00
stdtime On snap 950210, format %s (print seconds from the epoch) is missing 1995-03-01 23:08:40 +00:00
string Don't build swab.o here. It gets built in libc/i386/string. Previously 1995-03-07 04:19:11 +00:00
sys Updated manual page to indicate flags argument; added return value and 1995-03-25 17:24:47 +00:00
xdr More directory cleanup after YP merge. 1994-08-07 22:21:14 +00:00
yp Fix xdr_ypmap_parms() so that it agrees with xdr_domainname(), xdr_peername() 1995-04-02 19:58:29 +00:00
Makefile Add nls include to Makefile. 1995-03-30 12:46:36 +00:00