Please see my ANSWERs below:



----- Original Message ----
From: JINMEI Tatuya / 神明達哉
To: Fr34k
Cc: Bindlist
Sent: Monday, August 11, 2008 10:55:55 PM
Subject: Re: 9.5.0-P2 and socket: too many open file descriptors

At Mon, 11 Aug 2008 19:38:57 -0700 (PDT),
Fr34k wrote:

> Running 9.5.0-P2 on Solaris 9 and I continue to get "socket: too many open file descriptors" messages.
> I have tried "ulimit -n foobar" where foobar has been various numerical values and I still get the error.
> Am I just not assigning a large enough foobar?
> Do I have to recompile bind after such an adjustment?
> Should I tweak something else?


Usual question:
- did you build named with a large value of FD_SETSIZE?
ANSWER: No. I'm not even sure how to change it. Would I edit lib/isc/unix/socket.c? Should I change it?

- did you specify a reasonably large value for max-cache-size?
ANSWER: I have "max-cache-size 0 ;" I thought you, or a fellow isc person, said this would mean bind would regulate the size as it did in previous versions. Correct? Do you another suggestion?

- how many sockets were actually opened when you saw this message?
ANSWER: What is the best method to measure and capture this? lsof, pfiles, or ?

And you may also want to check the OS capability with this tool:
http://www.jinmei.org/selecttest.tgz

ANSWER: Done and the output is below. What do you think?
# ./selecttest
selecttest: nsocks = 4093, TEST_FDSETSIZE = -1, FD_SETSIZE = 1024, sizeof fd_set = 128
opening 2046th socket failed: Too many open files
# ulimit -a
core file size (blocks)**** 1000000
data seg size (kbytes)***** unlimited
file size (blocks)********* unlimited
open files***************** 2048
pipe size (512 bytes)****** 10
stack size (kbytes)******** 8192
cpu time (seconds)********* unlimited
max user processes********* 29995
virtual memory (kbytes)**** unlimited
# ./selecttest -r
selecttest: nsocks = 4093, TEST_FDSETSIZE = -1, FD_SETSIZE = 1024, sizeof fd_set = 128
created 4093 sockets, maxfd = 4095
FD_CLR test...OK
FD_SET test...OK
select: Invalid argument
select test...
# grep rlim /etc/system
set rlim_fd_max=4096
set rlim_fd_cur=2048
#

Interesting that when "-r" was used, select failed but the higher FD limit was recognized. Not sure how to interpret this.

---
JINMEI, Tatuya
Internet Systems Consortium, Inc.