Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change counterintuitive implementation of “Fastest IP address“ in case of non-A/AAAA response types #376

Open
TomTonic opened this issue Jan 8, 2024 · 1 comment

Comments

@TomTonic
Copy link

TomTonic commented Jan 8, 2024

Current behavior:
The switch “Fastest IP address“ makes AdGuard query all configured upstreams. Then…

  • if the upstreams return an A or AAAA record type, then AdGuard measures the time to open up a TCP connection to ports 80 and 443 of all returned IP addresses of all configured upstreams. AdGuard then return a manipulated DNS record, that only contains the fastest IP address.
  • else (i.e. the upstreams return a different record type) AdGuard enters the normal “load-balancing“ mode. (see
    // Go on to the load-balancing mode.
    )

Suggested behavior:
If the upstreams return a different record type than A or AAAA, then AdGuard enters the normal “Parallel requests“ mode, i.e. change line 28 to “return upstream.ExchangeParallel(ups, req)“ (like in

return upstream.ExchangeParallel(ups, req)
).

Rationale:
As a user of “Fastest IP address“ I have to accept that generally all upstreams are queried in order to get the best overall system performance. In the case of A/AAAA records that is the fastest content server (not the fastest DNS answer). In case of other record types, that would be the fastest DNS answer, in my opinion.

@TomTonic
Copy link
Author

Suggested implementation:

replace

// Go on to the load-balancing mode.

with

return upstream.ExchangeParallel(ups, req)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants