Re: Unbound on FreeBSD 11, uses just one of 8 threads?

2018-05-23 Thread Viktor Dukhovni via Unbound-users
On Wed, May 23, 2018 at 07:56:42AM +0200, W.C.A. Wijngaards wrote:

> > I have 8 threads configured, anyone know why unbound would
> > do all the work in just one thread?
> 
> Previously people that asked this, had a usage that one thread could
> satisfy.  Perhaps the other cpu cores are running some other process.

Or it seems that on FreeBSD (and perhaps other BSDs) SO_REUSEPORT
does not dispatch to multiple threads.  One thread gets all the
traffic.

> It it the systems scheduler for delivering packets to the listening
> network socket that determines which thread gets the content.
> so-reuseport: yes reportedly improves distribution between threads on Linux.

On FreeBSD it seems to cause all the traffic to go one thread.  I
turned it off, restarted unbound, and now all the threads are busy.
The throughput has not however changed significantly.  Perhaps as
you say one thread is enough...

-- 
Viktor.




Re: Unbound on FreeBSD 11, uses just one of 8 threads?

2018-05-22 Thread W.C.A. Wijngaards via Unbound-users
Hi Viktor,

On 23/05/18 01:45, Viktor Dukhovni via Unbound-users wrote:
> 
> I have 8 threads configured, anyone know why unbound would
> do all the work in just one thread?

Previously people that asked this, had a usage that one thread could
satisfy.  Perhaps the other cpu cores are running some other process.
It it the systems scheduler for delivering packets to the listening
network socket that determines which thread gets the content.
so-reuseport: yes reportedly improves distribution between threads on Linux.

Best regards, Wouter

> 
> Build info:
> 
>   # /usr/local/sbin/unbound -h
>   [...]
>   Version 1.7.1
>   linked libs: libevent 2.1.8-stable (it uses kqueue), OpenSSL 1.0.2o  27 Mar 
> 2018
>   linked modules: dns64 respip validator iterator
>   [...]
> 
> Configuration below my signature, stats below (the machine is
> running the DANE adoption survey, so yes, ~3.5 billion queries with
> a low cache hit rate is right):
> 
> # /usr/local/sbin/unbound-control stats_noreset | egrep -v '=0$'
> thread0.recursion.time.avg=0.00
> thread1.recursion.time.avg=0.00
> thread2.recursion.time.avg=0.00
> thread3.recursion.time.avg=0.00
> thread4.recursion.time.avg=0.00
> thread5.recursion.time.avg=0.00
> thread6.recursion.time.avg=0.00
> thread7.num.queries=3478975092
> thread7.num.cachehits=1422530
> thread7.num.cachemiss=3477552562
> thread7.num.recursivereplies=3477552317
> thread7.requestlist.avg=257.029
> thread7.requestlist.max=1266
> thread7.requestlist.current.all=245
> thread7.requestlist.current.user=245
> thread7.recursion.time.avg=0.220082
> thread7.recursion.time.median=0.0963222
> total.num.queries=3478975092
> total.num.cachehits=1422530
> total.num.cachemiss=3477552562
> total.num.recursivereplies=3477552317
> total.requestlist.avg=257.029
> total.requestlist.max=1266
> total.requestlist.current.all=245
> total.requestlist.current.user=245
> total.recursion.time.avg=0.220082
> total.recursion.time.median=0.0120403
> 




signature.asc
Description: OpenPGP digital signature