mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-03-04 00:01:12 -05:00
DoT much slower than DoH using the same servers #3070
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#3070
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 @timkgh on GitHub (Sep 23, 2021).
v0.106.3, using the default adguard filter with security and parental control filters.
Upstream DNS servers: 1.1.1.2, 9.9.9.9
Using DoH for both upstreams shows an average query time of about 28ms, but using DoT it is much slower at 81ms. All other settings are the same. Tests run over 24h for each.
Any ideas why that much slower? Are the TLS connections not kept alive or re-used a lot less than the https connections?
@timkgh commented on GitHub (Sep 24, 2021):
Ran some tests, here are my observations:
DoT: responses are generally fast, 25-50ms range, but every 7-10 requests I see 1-2 requests that take 200-300ms which pushes the averages up and is not great for responsiveness.
DoH, DoQ: smooth responses for long periods of time, with just occasional high response times of 100-300ms.
I suspect that DoT connections are maybe cycled much faster and that's the price for the TLS handshake.
Could AGH log when it establishes a new connection to the upstream? e.g. nextdns cli prints something like this in the log:
Connected x.x.x.x:443 (con=8ms tls=9ms, TCP, TLS13)@bcookatpcsd commented on GitHub (Sep 24, 2021):
@timkgh
I found things were much faster in the beta release..
(and I wish the logging was better too)
I use an sdns stamp to also cut down on looking up the host..
I've not looked into if that actually does reduce time.. but
My 0.02
I have one stream forward to NextDNS.. 4ms avg
@timkgh commented on GitHub (Sep 24, 2021):
4ms ... nice -- is that because of the new optimistic cache feature?
I just use IP addresses so there's no lookup and no need for bootstrap DNS, e.g. https://1.1.1.2/dns-query
I found that "load balancing" mode is problematic, it does quite the opposite of what it should do, based on empirical evidence.
https://github.com/AdguardTeam/AdGuardHome/discussions/3601#discussioncomment-1360429
AGH (and dnsproxy) might benefit from a look at performance, running some tests or at least collecting better stats so that users can report what they observe in practice.
@ameshkov commented on GitHub (Sep 27, 2021):
DOT upstream connections pool implementation is not ideal in general, we'll need to revisit it later at some point.