Subject: Re: Bind - too many open files
To: Rick Byers <rickb@iaw.on.ca>
From: Matthew Braun <matthew@ans.net>
List: netbsd-help
Date: 12/15/1996 14:18:55
Rick Byers <rickb@iaw.on.ca> on Sun, 8 Dec 1996 18:21 writes:
> I've got NetBSD 1.2, and I've been having some trouble with bind, so I
> upgraded it to V4.9.5, but I still have the same problem.  Our machine has
> about 256 IP addresses associated with it's only ethernet interface
> (virtual-host for web-sites), and named allways generates the folling
> errors when I try to restart it:  fcntl(dfd, F_DUPFD, 20): Too many open
> files socket(SOCK_DGRAM): Too many open files - exiting. 
> 
> The only way I can succesfully restart named is to reboot the system.  I
> used to be able to increase the limit of open files, but that has stopped
> working as well.  (ulimit -n 128 used to do the trick, now even ulimit -n
> 2048 gives the same error).  

Using ulimit worked for me, but then I found if you compile bind with
HAVE_GETRUSAGE defined, you can specify the number of allowed file
descriptors in named.boot.

Then I put this in the named.boot:

; needed because there are more than 64 virtual interfaces
; bind needs to be compiled with RLIMIT_NOFILE defined for this to work
limit files 128

Note, this was on Solaris 2.5.1 where RLIMIT_NOFILE was not defined by
default, but the calls needed are in the Solaris libraries.

Hope this helps,

Matthew.