On Wed, Apr 30, 2025 at 09:33:56AM +0300, Kapetanakis Giannis wrote:

> On 29/04/2025 22:19, Otto Moerbeek wrote:
> > If you looks more closely you'll see that resuseport and UDP do not
> > work well together for the multithreaded case. Alls packets end up in
> > one thread. 
> 
> Yes, so in you comment bellow I believe you meant "does *NOT* handle ... 
> multi-threaded case very well", correct?
> 
> According to a few tests I've done with pthread code as well as fork() and 
> SO_REUSEPORT,
> all connections end up in the same thread/process.
> 
> Fixing this would require something like SO_REUSEPORT_LB, like FreeBSD and 
> DragonFly did, or intervention on the daemon side to do the load balancing?
> 
> Alternatively running multiple 1-thread daemons and do some kind of load 
> balancing on the system, say with relayd.
> 
> thanks,

Some day the thread scheduling will be fixed, but until then you can
use PowerDNS Recursor, which can distribute queries itself to threads
(see package readme) or indeed run multiple instances of unbound with
a load balancer.

For DNS load balancing I would recommend dnsdist.

        -Otto

Reply via email to