]> granicus.if.org Git - pdns/commit
rec: Use one listening socket per thread when reuseport is enabled
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 1 Mar 2017 09:36:33 +0000 (10:36 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 7 Mar 2017 08:41:08 +0000 (09:41 +0100)
commit810ff70506fab6f074afbef854ae6042bad5ac0f
tree875b2b8abe0a7c9109eaaf6659702c41697dbd79
parent1896dee4109d5293c63671504e3234b5a5802de2
rec: Use one listening socket per thread when reuseport is enabled

Except if `pdns-distributes-queries` is true, of course.
We used to shared the same listening socket between all threads
when `pdns-distributes-queries` is set to false, even with `reuseport`
set to true and `SO_REUSEPORT` support available. After this commit:
* if `pdns-distributes-queries` is true, the distributor thread
is still the only one listening to incoming queries
* if `pdns-distributes-queries` is false and either `reuseport` is
false or `SO_REUSEPORT` support is not available, all threads share
the same listening socket as it was before
* if `pdns-distributes-queries` is false, `SO_REUSEPORT` support is
available and `reuseport` is true, we open a separate listening
socket per thread to let the kernel distribute the incoming queries
for us, avoiding any thundering herd issue as well as the distributor
thread being a bottleneck.
docs/markdown/recursor/settings.md
pdns/pdns_recursor.cc