Adgaurd Limit Concurrent requests per second
Prerequisites
-
[X] I have checked the Wiki and Discussions and found no answer
-
[X] I have searched other issues and found no duplicates
-
[X] I want to report a bug and not ask a question or ask for help
-
[X] I have set up AdGuard Home correctly and configured clients to use it. (Use the Discussions for help with installing and configuring clients.)
Platform (OS and CPU architecture)
Linux, AMD64 (aka x86_64)
Installation
GitHub releases or script from README
Setup
On one machine
AdGuard Home version
latest
Action
Just benchmark the adguard and you will see it won't go higher than around 27K Query Per Second
DNS Performance Testing Tool
Version 2.14.0
[Status] Command line: dnsperf -s 127.0.0.1 -p 53561 -c 1 -d test/query.txt -n 1
[Status] Sending queries (to 127.0.0.1:53561)
[Status] Started at: Tue Nov 26 06:11:41 2024
[Status] Stopping after 1 run through file
[Status] Testing complete (end of file)
Statistics:
Queries sent: 7020
Queries completed: 7020 (100.00%)
Queries lost: 0 (0.00%)
Response codes: NOERROR 7020 (100.00%)
Average packet size: request 27, response 43
Run time (s): 0.284940
Queries per second: 24636.765635
Average Latency (s): 0.003639 (min 0.000275, max 0.013657)
Latency StdDev (s): 0.001711
Expected result
around 50K or 100K per second at least
Actual result
around 26K per second
Additional information and/or screenshots
There is no There is no hardware limit, all good all ok, Please tell me what can I do ?
I even set max goroutine to 1500, but no difference
Please tell me what can I do ?
here is test results of my own dns server ( upstream of adguard )
root@cr-srv-st:~/test1# dnsperf -s 127.0.0.1 -p 5353 -c 1 -d test/query.txt -n 10
DNS Performance Testing Tool
Version 2.14.0
[Status] Command line: dnsperf -s 127.0.0.1 -p 5353 -c 1 -d test/query.txt -n 10
[Status] Sending queries (to 127.0.0.1:5353)
[Status] Started at: Tue Nov 26 06:13:31 2024
[Status] Stopping after 10 runs through file
[Status] Testing complete (end of file)
Statistics:
Queries sent: 70200
Queries completed: 70200 (100.00%)
Queries lost: 0 (0.00%)
Response codes: NOERROR 70200 (100.00%)
Average packet size: request 27, response 63
Run time (s): 1.050964
Queries per second: 66795.817935
Average Latency (s): 0.001348 (min 0.000051, max 0.014170)
Latency StdDev (s): 0.000915
here is the config file
http:
pprof:
port: 6060
enabled: false
address: 1xxxx:xxx
session_ttl: 720h
users:
- name: admin
password: $2a$10$xxxxxxx.xxx
auth_attempts: 5
block_auth_min: 15
http_proxy: ""
language: ""
theme: auto
dns:
bind_hosts:
- 0.0.0.0
port: 53561
anonymize_client_ip: false
ratelimit: 0
ratelimit_subnet_len_ipv4: 24
ratelimit_subnet_len_ipv6: 56
ratelimit_whitelist: []
refuse_any: true
upstream_dns:
- 127.0.0.1:5353
- 127.0.0.2:5353
- 127.0.0.3:5353
- 127.0.0.4:5353
upstream_dns_file: ""
bootstrap_dns:
- 127.0.0.1:5353
- 127.0.0.2:5353
- 127.0.0.3:5353
- 127.0.0.4:5353
fallback_dns: []
upstream_mode: load_balance
fastest_timeout: 1s
allowed_clients: []
disallowed_clients: []
blocked_hosts:
- version.bind
- id.server
- hostname.bind
trusted_proxies:
- 127.0.0.0/8
- ::1/128
cache_size: 0
cache_ttl_min: 0
cache_ttl_max: 0
cache_optimistic: false
bogus_nxdomain: []
aaaa_disabled: false
enable_dnssec: false
edns_client_subnet:
custom_ip: ""
enabled: true
use_custom: false
max_goroutines: 1000
handle_ddr: true
ipset: []
ipset_file: ""
bootstrap_prefer_ipv6: false
upstream_timeout: 10s
private_networks: []
use_private_ptr_resolvers: false
local_ptr_upstreams: []
use_dns64: false
dns64_prefixes: []
serve_http3: false
use_http3_upstreams: false
serve_plain_dns: true
hostsfile_enabled: true
tls:
enabled: false
server_name: ""
force_https: false
port_https: 443
port_dns_over_tls: 853
port_dns_over_quic: 853
port_dnscrypt: 0
dnscrypt_config_file: ""
allow_unencrypted_doh: false
certificate_chain: ""
private_key: ""
certificate_path: ""
private_key_path: ""
strict_sni_check: false
querylog:
dir_path: ""
ignored: []
interval: 2160h
size_memory: 1000
enabled: false
file_enabled: false
statistics:
dir_path: ""
ignored: []
interval: 24h
enabled: false
filters:
- enabled: true
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt
name: AdGuard DNS filter
id: 1
- enabled: false
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt
name: AdAway Default Blocklist
id: 2
whitelist_filters: []
user_rules: []
dhcp:
enabled: false
interface_name: ""
local_domain_name: lan
dhcpv4:
gateway_ip: ""
subnet_mask: ""
range_start: ""
range_end: ""
lease_duration: 86400
icmp_timeout_msec: 1000
options: []
dhcpv6:
range_start: ""
lease_duration: 86400
ra_slaac_only: false
ra_allow_slaac: false
filtering:
blocking_ipv4: ""
blocking_ipv6: ""
blocked_services:
schedule:
time_zone: Local
ids: []
protection_disabled_until: null
safe_search:
enabled: false
bing: true
duckduckgo: true
ecosia: true
google: true
pixabay: true
yandex: true
youtube: true
blocking_mode: default
parental_block_host: family-block.dns.adguard.com
safebrowsing_block_host: standard-block.dns.adguard.com
rewrites:
- domain: test.com
answer: 1.1.1.1
safe_fs_patterns:
- /root/RD/adguardtest/build/work/userfilters/*
safebrowsing_cache_size: 1048576
safesearch_cache_size: 1048576
parental_cache_size: 1048576
cache_time: 30
filters_update_interval: 24
blocked_response_ttl: 10
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
protection_enabled: true
clients:
runtime_sources:
whois: true
arp: true
rdns: false
dhcp: true
hosts: true
persistent: []
log:
enabled: true
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: false
local_time: false
verbose: false
os:
group: ""
user: ""
rlimit_nofile: 1048576
schema_version: 29
The problem is in dnsproxy ./dnsproxy -l 127.0.0.1 -p 5355 -u 127.0.0.1:5353 --max-go-routines=1000000
root@cr-srv-st:~/test1# dnsperf -s 127.0.0.1 -p 5355 -c 1 -d test/query.txt -n 10 DNS Performance Testing Tool Version 2.14.0
[Status] Command line: dnsperf -s 127.0.0.1 -p 5355 -c 1 -d test/query.txt -n 10 [Status] Sending queries (to 127.0.0.1:5355) [Status] Started at: Tue Nov 26 08:51:25 2024 [Status] Stopping after 10 runs through file [Status] Testing complete (end of file)
Statistics:
Queries sent: 70200 Queries completed: 70200 (100.00%) Queries lost: 0 (0.00%)
Response codes: NOERROR 70200 (100.00%) Average packet size: request 27, response 43 Run time (s): 2.805360 Queries per second: 25023.526392
Average Latency (s): 0.003816 (min 0.000183, max 0.028328) Latency StdDev (s): 0.002333
how does dnsmasq, powerdns and unbound compare?
I get over 70K request per second on my self developed dns server also I get much more on dnsmasq and unbount, please tell me what can I do to increase the speed
It's not using hardware resources, I have enough cpu and ram
Yes, you're right. The problem is with dnsproxy. If you need more than 50K requests per second, you can try running multiple instances behind a load balancer. But generally speaking, 26K requests per second is ~2 billion requests per day - which seems more than enough for any practical deployment.