From owner-freebsd-bugs Tue Dec 16 00:00:08 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA04924 for bugs-outgoing; Tue, 16 Dec 1997 00:00:08 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id AAA04905; Tue, 16 Dec 1997 00:00:02 -0800 (PST) (envelope-from gnats) Date: Tue, 16 Dec 1997 00:00:02 -0800 (PST) Message-Id: <199712160800.AAA04905@hub.freebsd.org> To: freebsd-bugs Cc: From: Bruce Evans Subject: Re: bin/5306: gethostbyname() returns herror "Unknown host" on well known hosts Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR bin/5306; it has been noted by GNATS. From: Bruce Evans To: freebsd-gnats-submit@FreeBSD.ORG, robert@superior.net Cc: Subject: Re: bin/5306: gethostbyname() returns herror "Unknown host" on well known hosts Date: Tue, 16 Dec 1997 18:49:02 +1100 >>Description: >When on a well loaded system, gethostbyname() will return "Unknown >Host" on well known hosts. (ie: mit.edu, internic.net, etc.) On a loaded >... >Not sure if this makes a difference, this kernel has: >options "CHILD_MAX=256" >options "OPEN_MAX=256" These are bogus, but misconfiguring the soft openfiles limit by abusing OPEN_MAX like this makes the problem less obvious. The default limit is 64 in 2.2.5 and "infinite" in -current. >Load up a BSD system in which a lot of file discriptors are used. >Compile and run something easy such as Squid and see that it's DNS >systems fail. On this system named is running. This is not that >difficult to reproduce. >>Fix: >No fix as of 2.2.5-STABLE At least for the test program in PR 3622, the fix is to configure enough fd's using /etc/login.conf. In 2.2.5, the default openfiles limits for class daemon are 1024 (hard) and OPEN_MAX (soft). These should be set as large as necessary (but no larger) for each class of user. There is also an evil sysctl limit `kern.maxfilesperproc' with the default value of 2*NPROC. This interferes with correct operation of login.conf. If it is too small, then the easiest way to fix it is to edit /sys/conf/param.c and build a new kernel. There is also a good sysctl limit `kern.maxfiles' with the default value of 2*NPROC. This is easy to change at runtime using `sysctl -w kern.maxfiles=...'. (Changing kern.maxfilesperproc at runtime doesn't work well because it can't increase the openfiles limits in the process tree. It can only decrease them.) Bruce