DNS rate limits count queries across every instance that shares the ValKey server #73
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.
Blocks
Depends on
Reference
lantea-one/ninlil#73
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?
Why
The token buckets and subnet windows are in-process dictionaries (
src/dotnet/src/Ninlil.Dns.Server.RateLimiting/TokenBucketDnsRateLimiter.cs:66,73).What changes
Technical design: a hybrid, so the query path never waits on the network.
INCRBY <prefix>:rl:ip:<addr>:<window>withPEXPIRE, and reads back the cluster total.QueriesPerSecond × window(or the subnet limits) is marked "over" locally until the window ends.TryAcquireAsyncandCheckSubnetLimitAsyncthen deny it.MaxTrackedClients,TokenBucketDnsRateLimiter.cs:184-191).TokenBucketDnsRateLimiter.csValkeyRateLimitSynchroniserinNinlil.Dns.Server.RateLimiting(the project referencesNinlil.Common.Valkey)src/dotnet/src/Ninlil.Dns.Server.RateLimiting/Extension/ServiceCollectionRateLimitingExtension.csIDnsRateLimiter.csAcceptance
TryAcquireAsyncfor that IP returns false although the local bucket has tokens.Pipeline/latency is unchanged within noise. Copy the result into the issue.src/dotnet/tests/Ninlil.Dns.Server.RateLimiting.Testspasses.ENVIRONMENT.mdupdated if an option is added.Source