-
Notifications
You must be signed in to change notification settings - Fork 72
Description
I have been running routedns for over a week now and coming from blocky, the average response time is higher. I am not sure if that is because my configuration is sub optimal.
At the moment I have both blocky and routedns running with AdGuard Home using them as upstream. Looking at average upstream stats for last 24 hours, routedns is 63ms and blocky is 27ms. Blocky handled 68.9% of the queries and routedns did 31.1%. Due to lower average response times, AGH prefers blocky over routedns. Previously running 2 blocky instances, the split was roughly even.
Both of them have the exact same DoH upstreams. RouteDNS has bootstrap address configured whereas block doesn't.
Caching & prefetch
One of the things I have been noticing is that, there is a lot more cache misses with routedns compared to blocky and it is causing the averages to shoot up.
Blocky is configured to prefetch any query that gets more than 5 hits in a 3 hour window with maximum of 250 total items it can keep for prefetching before dropping the oldest one. It also sets the minimum TTL and maximum TTL.
caching:
minTime: 2m
maxTime: 24h
maxItemsCount: 1000
prefetching: true
prefetchExpires: 3h
prefetchThreshold: 5
prefetchMaxItemsCount: 250
cacheTimeNegative: 1m
I have tried to match it in routedns to some extent. I am aware routedns will prefetch everything unlike blocky but it doesn't appear to be working that well from what I can see based on response times for queries. Especially on repeated queries where the gap between each is longer than 5 minutes.
[groups.stub-resolver-cache]
type = "cache"
resolvers = ["stub-updated-ttl"]
cache-answer-shuffle = "random"
cache-flush-query = "flush.cache."
cache-prefetch-trigger = 10
cache-prefetch-eligible = 20
cache-rcode-max-ttl = { 3 = 60, 5 = 60 }
backend = { type = "memory", size = 1000, filename = "/tmp/stub-resolver-cache.json", save-interval = 300 }
[groups.stub-updated-ttl]
type = "ttl-modifier"
resolvers = ["doh"]
ttl-min = 120
ttl-max = 86400
Upstream query latency
So for cache misses, blocky seems to perform a bit better than routedns. For example, blocky would mostly do about 20ish ms for upstream queries compared to routedns which is about 30ish ms on average.
Blocky doesn't support QUIC so it is standard DoH with TLS 1.2 as minimum and upstream timeout set to 2s. Everything is else is left to defaults.
minTlsServeVersion: 1.2
upstreams:
timeout: 2s
In RouteDNS I have configured the following
- Timeout set to 2 seconds
- quic & O-RTT enabled for cloudflare & Google upstreams.
RouteDNS has the advantage of not having to resolve the records as bootstrap address is configured. The average response time is higher if you don't specify bootstrap address so it did help bring down the average a bit.
I also did bump the hard coded timeout from 30 to 90 seconds and compiled it. It seems to have made a slight difference but not much.
As I am not familiar with Go, not sure what blocky does differently such that the latency is a bit lower for querying upstream.
RouteDNS is a great tool and thank you for making it. I love the flexibility it gives on what you can do with processing pipelines. If caching can be improved and query latency can be reduced, it would make it even more great. I would love to drop blocky and have RouteDNS do everything.