Maintained by: NLnet Labs

[Unbound-users] FreeBSD + Unbound 1.0.2 error: too many file descriptors requested

Wouter Wijngaards
Mon Aug 11 09:32:09 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Dmitriy,

Unbound 1.0.2 calculates the maximum number of open files.  And checks
if that is going to work. So that it does not start OK, but later on,
when it is busy, fails.  This error is because the select system call
has a hardcoded limit of 1024 (limited by the system).

Libevent does not work for you?

OK an alternative.
Compile unbound with ./configure --without-pthreads

Then, you can even set the outgoing-range to 256, or 512 or 768
File descriptors are less of a problem.

The downside is unbound will fork processes, and every process has it's
own cache memory.  So it uses more memory, 8x more memory with 8
'num-threads:' setting.

On the plus side, its 10-20% faster :-)

Best regards,
~   Wouter


Dmitriy Demidov wrote:
| Hello unbound-users!
|
| I'm runing unbound-1.0.2 installed from ports, under FreeBSD 7.0
| Unbound is installed without libevent. Yesterday I have done
portupgade from
| unbound-1.0.1 to unbound-1.0.2
|
| Now I met the following problem - Unbound do not starts. I found the
reasone -
| it is because of value of num-threads set. Old Unbound 1.0.1
configuration
| has been set to use num-threads: 8 , but Unbound 1.0.2 can be started
only
| with setting num-threads: to 3 or less.
|
| When I try to start Unbound with num-threads: 4 or more, unbound says
to me
| that:
|
| # /usr/local/etc/rc.d/unbound start
| Starting unbound.
| [1218219064] unbound[3358:0] error: too many file descriptors
requested. The
| builtinmini-event cannot handle more than 1024. Config for less fds or
| compile with libevent
| [1218219064] unbound[3358:0] fatal error: configuration needs too many
file
| descriptors
|
| ---
|
| My system is configured this way:
|
| ulimit -a
| core file size          (blocks, -c) 0
| data seg size           (kbytes, -d) 524288
| file size               (blocks, -f) unlimited
| max locked memory       (kbytes, -l) unlimited
| max memory size         (kbytes, -m) unlimited
| open files                      (-n) 20095
| pipe size            (512 bytes, -p) 1
| stack size              (kbytes, -s) 65536
| cpu time               (seconds, -t) unlimited
| max user processes              (-u) 5547
| virtual memory          (kbytes, -v) unlimited
|
| ---
|
| My unbound.conf:
|
| server:
|         verbosity: 0
|         #statistics-interval: 3600
|         #num-threads: 8
|         num-threads: 3
|         interface: 0.0.0.0
|         port: 53
|         outgoing-range: 256
|         msg-cache-size: 16m
|         msg-cache-slabs: 4
|         num-queries-per-thread: 1024
|         rrset-cache-size: 32m
|         rrset-cache-slabs: 4
|         cache-max-ttl: 86400
|         infra-host-ttl: 900
|         infra-lame-ttl: 900
|         infra-cache-slabs: 4
|         infra-cache-numhosts: 10000
|         infra-cache-lame-size: 10k
|         do-ip4: yes
|         do-ip6: no
|         do-udp: yes
|         do-tcp: yes
|         do-daemonize: yes
|
|         access-control: 0.0.0.0/0 refuse
|         access-control: 127.0.0.0/8 allow
|         access-control: ::0/0 refuse
|         access-control: ::1 allow
|         access-control: ::ffff:127.0.0.1 allow
|
|         chroot: "/usr/local/etc/unbound"
|         username: "unbound"
|         directory: "/usr/local/etc/unbound"
|         #logfile: "/usr/local/etc/unbound/unbound.log"
|         logfile: ""
|         use-syslog: no
|         pidfile: "/usr/local/etc/unbound/unbound.pid"
|         root-hints: "/usr/local/etc/unbound/named.cache"
|
|         identity: "DNS"
|         version: "1.0"
|         hide-identity: yes
|         hide-version: yes
|         harden-glue: yes
|         do-not-query-address: 127.0.0.1/8
|         do-not-query-address: ::1
|         do-not-query-localhost: yes
|         module-config: "iterator"
|
| ---
|
| AFAIK my unbound configuration with num-threads: 4 will requests only
256x4 =
| 1024 file descriptors + 20 for TCP. In the same time there is system wide
| ilimit for 20095 file descriptors...
|
| Do this behaviour is because of hard coded threshold in Unbound?
| If file descriptors count is >= 1024 and no libevent is used, then
Unbound
| will stops with this error message?
|
|
| You see, right now, under FreeBSD there is only libevent 1.3e
available in
| ports, and I do not want to use it because of problems that it
produced to me
| before... :(  I have a negative experience with Unbound 1.0 and libevent
| 1.3e, so I do not want to use it. This libevent version makes Unbound
| unstable.
|
| _______________________________________________
| Unbound-users mailing list
| Unbound-users at unbound.net
| http://unbound.nlnetlabs.nl/mailman/listinfo/unbound-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkif6vkACgkQkDLqNwOhpPjcQwCgnr4/Y5EdGrSys+VjbwMPXuQS
UyUAn0oB7CKpDmKs2ZQg6TuuNz1Sby3c
=bCdF
-----END PGP SIGNATURE-----