The DNSCrypt forwarder client's TCP path does not set NoDelay and sends the length prefix and the packet separately #467
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lantea-one/ninlil#467
Loading…
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?
Found while the DNSCrypt-over-TCP benchmark (#226) was written. Not measured.
DnsCryptForwarderClient.SendTcpAsync(src/dotnet/src/Ninlil.Dns.Server.Forwarding/Clients/DnsCryptForwarderClient.cs, about line 460) does not setNoDelayon its socket and writes the 2-byte length prefix and the packet as two sends. Two small writes followed by a read is the pattern in which Nagle's algorithm and the peer's delayed acknowledgement can add tens of milliseconds to a query. It is the upstream-client side (used when a DNSCrypt upstream falls back to TCP), not the listener.NoDelay, as the plain TCP and TLS forwarder clients do (check what they do and make the three alike).DnsCryptTcpListener.cs(about lines 191-195) justifiesNoDelaywith pipelined batches. DNSCrypt over TCP is one transaction per connection here (the listener closes after the first answer), so the comment's reason does not apply. Correct the comment to the reason that does (a small reply on a connection that is about to close must not wait).