Skip to content

Commit d7ca4c9

Browse files
committed
Use a more aggressive default value for TimeoutLoadReduction
People tend to over-provision
1 parent 9af397d commit d7ca4c9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

dnscrypt-proxy/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func newConfig() Config {
148148
SourceDoH: true,
149149
SourceODoH: false,
150150
MaxClients: 250,
151-
TimeoutLoadReduction: 0.4,
151+
TimeoutLoadReduction: 0.75,
152152
BootstrapResolvers: []string{DefaultBootstrapResolver},
153153
IgnoreSystemDNS: false,
154154
LogMaxSize: 10,

dnscrypt-proxy/config_loader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ func configureServerParams(proxy *Proxy, config *Config) {
173173
proxy.maxClients = config.MaxClients
174174
proxy.timeoutLoadReduction = config.TimeoutLoadReduction
175175
if proxy.timeoutLoadReduction < 0.0 || proxy.timeoutLoadReduction > 1.0 {
176-
dlog.Warnf("timeout_load_reduction must be between 0.0 and 1.0, using default 0.4")
177-
proxy.timeoutLoadReduction = 0.4
176+
dlog.Warnf("timeout_load_reduction must be between 0.0 and 1.0, using default 0.75")
177+
proxy.timeoutLoadReduction = 0.75
178178
}
179179
proxy.mainProto = "udp"
180180
if config.ForceTCP {

dnscrypt-proxy/example-dnscrypt-proxy.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ keepalive = 30
197197
## approaches max_clients to prevent overload. Value must be between 0.0 and 1.0.
198198
## 0.0 = no reduction, 1.0 = maximum reduction.
199199
## Uses a quartic curve to keep timeout high at low load and reduce sharply near limit.
200-
## For example, with timeout=5000ms, max_clients=250, and timeout_load_reduction=0.4:
201-
## - At 125 connections (50% load): timeout remains ~4875ms (97.5%)
202-
## - At 187 connections (75% load): timeout reduces to ~4373ms (87.5%)
203-
## - At 225 connections (90% load): timeout reduces to ~3687ms (73.7%)
204-
## - At 250 connections (100% load): timeout reduces to ~3000ms (60%)
200+
## For example, with timeout=5000ms, max_clients=250, and timeout_load_reduction=0.75:
201+
## - At 125 connections (50% load): timeout remains ~4765ms (95.3%)
202+
## - At 187 connections (75% load): timeout reduces to ~3826ms (76.5%)
203+
## - At 225 connections (90% load): timeout reduces to ~2539ms (50.8%)
204+
## - At 250 connections (100% load): timeout reduces to ~1250ms (25%)
205205
## This helps maintain responsiveness under high load by failing fast.
206206

207-
# timeout_load_reduction = 0.4
207+
# timeout_load_reduction = 0.75
208208

209209
## Set to `true` to enable hot reloading of configuration files (like allowed-names.txt,
210210
## blocked-names.txt, etc.) when they are modified. This can increase CPU and memory usage.

0 commit comments

Comments
 (0)