mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-03-04 00:01:12 -05:00
[Feature Request] Add a possibility to use Unix Domain sockets #3186
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#3186
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 @DavidOsipov on GitHub (Nov 13, 2021).
Dear developers,
I would like to request a feature - a possibility for Adguard Home to use Unix domain sockets.
Desired behavior:
A possibility to change
bind_host,upstream_dns,bootstrap_dns,port_https,port_dns_over_tls,port_dns_over_quicto listen to inputs likehttps+unix:/path/to/a/socket;http+unix:/path/to/a/socket;quic+unix:/path/to/a/socket,dns+unix:/path/to/a/socket(the last two are only possible to use with Unix domain Datagram sockets | SOCK_DGRAM)In other words, Adguard home would be able to receive requests via Unix domain sockets and contact an upstream server (Unbound for example) also via a Unix domain socket.
Implications:
In general, Unix domain sockets are 1.5-2 times faster, than IP sockets. The possibility to strip TLS or QUIC layer on a webserver like Nginx and then forward traffic through a Unix domain socket to Adguard home could introduce benefits like there would be no need to do a TLS handshakes several times, traffic won't be susceptible to standard routing schemes of IP sockets, which would increase performance and decrease latency. Most probably, the improvements would be much higher on high load servers or low-performance instances such as small VPS.
The exact numbers on possible performance benefit I do not possess, but let me cite Eli Bendersky:
"Unix domain sockets in Go" Eli Bendersky's website
As DNS packet size is also quite small, introducing this feature could greatly benefit performance.
Nginx webserver already has configurations, which allow to accept, decode, cache and forward DNS, DoT, DoH traffic - in other words, to strip encryption layer and forward requests to an upstream server (here and here). And according to @ameshkov in this discussion , using a reverse proxy in front of Adguard Home is the recommended way:
Possible complications:
As @ainar-g mentioned in the discussion, Adguard home depends on a
dnsproxymodule, which, most probably, would be heavily rewritten or replaced in the future. Unfortunately, I'm not a developer and can't help you by writing code, so it's up to you to decide whether or when to implement this feature, it could as well remain in the backlog until it becomes feasible to implement. I would just again cite Eli Bendersky:"Unix domain sockets in Go" Eli Bendersky's website