*BSD News Article 96124


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.internetmci.com!news.jb.com!monalisa.primelogic.com!user
From: michelle@primelogic.com (Michelle Brownsworth)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: ifconfig limit reached?
Date: Sat, 24 May 1997 21:45:03 -0700
Organization: PrimeLogic Communications Corp.
Lines: 48
Message-ID: <michelle-2405972145030001@monalisa.primelogic.com>
NNTP-Posting-Host: monalisa.primelogic.com
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:41575

Update on the problem and the solution:  To reiterate, after I had added
an IP alias for a virtual host to the network card, named choked and did a
core dump, complaining bitterly about too many open files; none of the DNS
zone files were loaded, so nslookup didn't even know the server's name. 
My first assumption, that there was a limit to the number of aliases that
could be assigned to a network card, turned out to be a red herring.  The
problem was that I had exceeded the limit on the number of files open per
process.  The default limit for a shell process was set to 64, as shown by
the following inquiries:

   From csh:

   wintermute% limit openfiles
   openfiles       64

   From sh:

   wintermute# ulimit -n
   64

[Note: Releases 2.2.x and 3.x.x might use "descriptors" rather than
"openfiles."  I'm using release 2.1.5 (yes, yes, I know--but it's
rock-solid), which calls it "openfiles."]

Because named needs one file descriptor per interface alias, and a few
more are needed for overhead, the maximum number of file descriptors had
been exceeded when the new alias was added.  The solution was to increase
the limit before the /etc/rc script started named.  I'm reluctant to add
stuff to the rc scripts directly, so I inserted the following lines in the
Netconfig section of /etc/sysconfig, just above the named flags section:

   # Increase maximum number of file descriptors per process
   ulimit -n 256

(Admittedly, 256 is probably more than necessary, but a neighboring ISP's
Linux-based server used 256 as the default, so I went for it.)  After
adding the new virtual's alias to netstart and rebooting, the DNS zone
files loaded normally, and nslookup verified everything was finer'n frog
hair.  All's well that ends.

Thanks to Steinar Haug and Inus Scheepers for pointing me in the right
direction.

.\\ichelle
--------------------
Michelle Brownsworth
System Administrator
IMS, Inc.