FS#34346 - [unbound] Setting num_threads to 2 makes unbound fail in ,multicore machine
Attached to Project:
Community Packages
Opened by Mike Cloaked (mcloaked) - Sunday, 17 March 2013, 16:59 GMT
Last edited by Gaetan Bisson (vesath) - Tuesday, 19 March 2013, 01:07 GMT
Opened by Mike Cloaked (mcloaked) - Sunday, 17 March 2013, 16:59 GMT
Last edited by Gaetan Bisson (vesath) - Tuesday, 19 March 2013, 01:07 GMT
|
Details
Description:
In a multicore machine it should be possible to have num_threads set to 2 in unbound.conf - however, doing so makes unbound fail to load. Additional info: * package version(s) unbound 1.4.19-2 * config and/or log files etc. Config file attached Steps to reproduce: unbound-checkconf unbound.conf unbound-checkconf: no errors in unbound.conf.debug systemctl start unbound using the attached config file. ( it would have to be amended to suit the system being used to run additional tests - and for example make sure that nsd is running or remove the forwarding lines for that, and the log file exists or remove the logging line.) Unbound will not start. This is possibly an upstream bug? |
This task depends upon
systemctl start unbound (or restart as relevant) gives:
[root@lapmike3 unbound]# systemctl status unbound
unbound.service - Unbound DNS Resolver
Loaded: loaded (/usr/lib/systemd/system/unbound.service; enabled)
Active: active (running) since Mon 2013-03-18 10:11:58 GMT; 1s ago
Main PID: 841 (unbound)
CGroup: name=systemd:/system/unbound.service
└─841 /usr/sbin/unbound -d
Mar 18 10:11:58 lapmike3 systemd[1]: Started Unbound DNS Resolver.
Mar 18 10:11:58 lapmike3 unbound[841]: [1363601518] unbound[841:0] warning: too many file descriptors requested. The builti...ibevent
Mar 18 10:11:58 lapmike3 unbound[841]: [1363601518] unbound[841:0] warning: continuing with less udp ports: 477
So unbound fails to start fully without the problems listed.
The lines in /var/log/messages.log relevant to this status are:
Mar 18 10:11:58 localhost unbound[841]: [1363601518] unbound[841:0] warning: too many file descriptors requested. The builtinmini-event cannot handle more than 1024. Config for less fds or compile with libevent
Mar 18 10:11:58 localhost unbound[841]: [1363601518] unbound[841:0] warning: continuing with less udp ports: 477
Maybe the package was compiled without libevent (?) so cannot handle the increase requested by the change of num_threads parameter?
If the lines containing:
num-threads: 2
# num-threads: 1
are swapped over by commenting out the first and uncommenting the second with no other changes at all then restarting unbound gives:
[root@lapmike3 unbound]# systemctl restart unbound
[root@lapmike3 unbound]# systemctl status unbound
unbound.service - Unbound DNS Resolver
Loaded: loaded (/usr/lib/systemd/system/unbound.service; enabled)
Active: active (running) since Mon 2013-03-18 10:12:27 GMT; 1s ago
Main PID: 848 (unbound)
CGroup: name=systemd:/system/unbound.service
└─848 /usr/sbin/unbound -d
Mar 18 10:12:27 lapmike3 systemd[1]: Starting Unbound DNS Resolver...
Mar 18 10:12:27 lapmike3 systemd[1]: Started Unbound DNS Resolver.
So it then works without warnings printed merely by changing num_threads from 2 to 1.
The system that this is running on has an Intel Core Duo with 2 processors. T9300 @ 2.50GHz and the system is arch x86_64 with kernel:
3.7.10-1-ARCH
If you need further information I will try to provide the details.
http://www.unbound.net/documentation/howto_optimise.html
So num_threads can't be increased arbitrarily to the number of cores, but if increased above the value of 1, then it has to be done in combination with limiting both the outgoing-range and the num-queries-per-thread parameters.
This was far from immediately obvious but having the following parameters works fine.
num-threads: 2
outgoing-range: 450
num-queries-per-thread: 225
So this is not a bug but it is sufficiently difficult to find how to make it work that I will add this to the wiki for unbound to try to help other users.
This task can be closed.