Maintained by: NLnet Labs

[Unbound-users] Threading in Solaris with libevent

Mike Emigh
Wed Mar 10 09:37:48 CET 2010


Hello,

I'm having some trouble getting Unbound 1.4.2 (and every other
version) to run with libevent with multiple threads on Solaris 10
10/09 x86.  I am using the Sun Studio 12 compiler to building from
source (I have tried with many different versions of gcc but the
compile always errors out).

I have tried multiple scenarios:
1. Compiling with the options --without-pthreads
--without-solaris-threads works fine.  The server starts and works as
expected.

2. Compiling with no options works fine.  I can run with 1 thread or
many and the server works as expected.

3. Compiling with --with-libevent and using libevent-1.4.13. This
works fine when the configuration is set to start only 1 thread.  If
more than 1 thread is started, then the logs fill up with messages
"unbound: [ID 993594 daemon.error] [10258:1] error: could not
event_del on close".  When I stop the test, a few seconds later when
the threads stop working, unbound crashes. I could only find one
previous thread related to this while using select in Solaris, but
this does not appear to be the same.  libevent should be using
/dev/poll and I have kept the file descriptors low and still get the
messages and crash: "[1268198366] unbound[10262:0] warning: increased
limit(open files) from 256 to 734".

I've seen better performance from 2.0.4-alpha, but it also crashes the
server and it does not pass the regression tests after compiling.  I
plan to post on the libevent mailing list, but looks like there is a
routing loop preventing me from accessing it right now.

4. Compiling with --with-libevent and using libev-3.9.  The server
starts fine and responds to queries.  If I run performance tests where
I hit with multiple queries (slow or fast) each thread will bring a
CPU to 100% and stay that way until the thread is done working.  When
I stop the test, a few seconds later when the threads stop working,
unbound crashes.  No errors messages are every produced.

Does anyone have any ideas on how I could get this working?  I would
prefer to have a multithreaded Unbound over the multi-process Unbound
(I am able to get this working).

Thanks,
Mike