TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
3.86k stars 401 forks source link

Can you please explain: Forwarder Concurrency #777

Closed bcookatpcsd closed 4 months ago

bcookatpcsd commented 7 months ago

Sorry to bother..

(valid range 1-10; default 2) The number of concurrent requests that the forwarder or conditional forwarder resolver must send when resolving a domain name.

I am confused what this means.. if it cannot resolve is it marked down? or something else?

Assuming I have two udp upstream, what would be the impact of changing the default to 1

or

Assuming I have four udp upstream, what would be the impact of changing the value to 1

Is the '2' upstream threads?

(ie states or open socket connections to each of the defined forwarders?) - or something else?

Thank you in advance.

ShreyasZare commented 7 months ago

Thanks for asking. Forwarder concurrency is the max concurrent requests that the DNS server will make for resolving the query. So, if you have more than one forwarders configured then they are selected at random. If the concurrency is set to 2 then two random forwarders from the list will be selected for concurrent requests. The first response that is received is used and the other open connection is closed. If both forwarders fail to respond then the next random forwarder will get picked up to try.

I am confused what this means.. if it cannot resolve is it marked down? or something else?

No forwarder is marked as down since its quite common to have timeout issues.

Assuming I have two udp upstream, what would be the impact of changing the default to 1

Only one request would be made at a time and if that fails then the second upstream will be tried.

Is the '2' upstream threads?

Yes, concurrency means 2 threads but these are async calls so no actual thread is waiting/blocked.

(ie states or open socket connections to each of the defined forwarders?) - or something else?

There will be 2 sockets open if concurrency is set to 2. Except on windows platform where 2500 sockets with random port are always kept available for use to provide port randomization feature.