mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-03-04 00:01:12 -05:00
How does the server decide which upstream provider to use? #845
Labels
No labels
P1: Critical
P2: High
P3: Medium
P4: Low
UI
bug
cannot reproduce
compatibility
dependencies
docker
documentation
duplicate
enhancement
enhancement
external libs
feature request
good first issue
help wanted
infrastructure
invalid
localization
needs investigation
performance
potential-duplicate
question
recurrent
research
snap
waiting for data
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AdGuardHome#845
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jamesponddotco on GitHub (Aug 7, 2019).
Hey 👋🏻,
If I am running AdGuard Home on a VPS with several DNSCrypt providers, how does the service decide which upstream to use for a query?
Let us say that the server running AdGuard Home is hosted in Iceland, I am based in Argentina, and I have upstream providers based in Japan, Australia, USA, Netherlands, Argentina and Iceland.
Will AdGuard Home choose the provider closest to me, i.e. the one in Argentina, closest to the server where it is deployed, i.e. Iceland, or at random? In my tests, it seems random, but I might be testing wrong — using dnsleaktest.com.
With the server in Germany, me being in Brazil and using DNSCrypt servers I have around the globe, dnsleaktest.com sometimes show the Brazilian server, sometimes the Tokyo one, sometimes the one from Miami and so on.
Thanks for the great project, by the way!
@ameshkov commented on GitHub (Aug 7, 2019):
Here you can take a look:
https://github.com/AdguardTeam/dnsproxy/blob/master/proxy/proxy.go#L425
Upstreams are sorted by the average round-trip-time, the one with the lowest value will be used.
If RTT values for your servers are close to each other, this might look like random.
@jamesponddotco commented on GitHub (Aug 7, 2019):
Hey @ameshkov,
Thanks for the reply!
Is the average round-trip-time compared to the server where AdGuard Home is installed or compared to the location of the client? I am guessing it is the server — which explains why the DNSCrypt server in Brazil is rarely used.
@ameshkov commented on GitHub (Aug 7, 2019):
Well, to put it simply, AGH just measures the time from sending the request to receiving the response and calls this RTT:) So yeah, if the server is far from AGH, the RTT will be higher.
@jamesponddotco commented on GitHub (Aug 7, 2019):
I am assuming DNSCrypt-Proxy works in a similar fashion, which explains why I get similar results when using Pi-hole with that.
Thanks, that explains a lot!