mokeyish / smartdns-rs

A cross platform local DNS server (Dnsmasq like) written in rust to obtain the fastest website IP for the best Internet experience, supports DoT, DoQ, DoH, DoH3.
GNU General Public License v3.0
590 stars 40 forks source link

性能恶劣? #80

Open PikuZheng opened 1 year ago

PikuZheng commented 1 year ago

使用dnspref测试,脚本参考 https://github.com/pymumu/smartdns/issues/1337#issuecomment-1475349744

受cpu性能限制,c++查询效率大约每秒2万次(目标5万次),cpu使用率90%以上 https://github.com/pymumu/smartdns/issues/1337#issuecomment-1475529602

rust版采用相同配置,查询效率大约每秒2百次,cpu使用率约20%。

localhost:~/test# sh ./runquerypref.sh
DNS Performance Testing Tool
Version 2.11.1

[Status] Command line: dnsperf -p 53 -s 172.19.0.4 -d ./data/querytest_400W.txt
[Status] Sending queries (to 172.19.0.4:53)
[Status] Started at: Wed Mar 22 14:51:15 2023
[Status] Stopping after 1 run through file
^C[Status] Testing complete (interruption)

Statistics:

  Queries sent:         677060
  Queries completed:    676960 (99.99%)
  Queries lost:         0 (0.00%)
  Queries interrupted:  100 (0.01%)

  Response codes:       NOERROR 676960 (100.00%)
  Average packet size:  request 31, response 63
  Run time (s):         2886.670816
  Queries per second:   234.512365

  Average Latency (s):  0.426340 (min 0.058085, max 3.345481)
  Latency StdDev (s):   0.368039

image

·测试结果符合预期吗? ·如何提高运行效率(比如更换编译器、静态链接、增加内存)?

mokeyish commented 1 year ago

还有很大上升空间啊😂。

mokeyish commented 1 year ago

@PikuZheng

我在 linux x86_64 测了下,把线程数放开后,Rust 版性能比 C 版,好差不多 30 %(但会丢失一小部分的查询)

你重新再测一下?


Rust 版 图片


C 版

图片


Rust 版,工作线程数,可用下面的方式配置,使用的线程数量,默认是 CPU 的核数

num-workers 4

https://github.com/mokeyish/smartdns-rs/blob/fea125cf7c06b431015c41c876b8ab12e6c3c1a8/src/dns_conf.rs#L1684

Sets the number of worker threads the Runtime will use.

This can be any number above 0 though it is advised to keep this value on the smaller side.

This will override the value read from environment variable TOKIO_WORKER_THREADS. Default

The default value is the number of cores available to the system.

When using the current_thread runtime this method has no effect.

PikuZheng commented 1 year ago

新版编译不过去。。。坑

mokeyish commented 1 year ago

新版编译不过去。。。坑

什么问题?

PikuZheng commented 1 year ago
error[E0425]: cannot find value `DCCP_SOCKOPT_SERVICE` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2452:23
     |
2452 |                 libc::DCCP_SOCKOPT_SERVICE,
     |                       ^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_SERVICE` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2466:66
     |
2466 |         unsafe { getsockopt(self.as_raw(), libc::SOL_DCCP, libc::DCCP_SOCKOPT_SERVICE) }
     |                                                                  ^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_CCID` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2475:66
     |
2475 |         unsafe { setsockopt(self.as_raw(), libc::SOL_DCCP, libc::DCCP_SOCKOPT_CCID, ccid) }
     |                                                                  ^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_TX_CCID` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2486:66
     |
2486 |         unsafe { getsockopt(self.as_raw(), libc::SOL_DCCP, libc::DCCP_SOCKOPT_TX_CCID) }
     |                                                                  ^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_RX_CCID` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2497:66
     |
2497 |         unsafe { getsockopt(self.as_raw(), libc::SOL_DCCP, libc::DCCP_SOCKOPT_RX_CCID) }
     |                                                                  ^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_SERVER_TIMEWAIT` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2511:23
     |
2511 |                 libc::DCCP_SOCKOPT_SERVER_TIMEWAIT,
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_SERVER_TIMEWAIT` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2529:23
     |
2529 |                 libc::DCCP_SOCKOPT_SERVER_TIMEWAIT,
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_SEND_CSCOV` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2548:23
     |
2548 |                 libc::DCCP_SOCKOPT_SEND_CSCOV,
     |                       ^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_SEND_CSCOV` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2562:66
     |
2562 |         unsafe { getsockopt(self.as_raw(), libc::SOL_DCCP, libc::DCCP_SOCKOPT_SEND_CSCOV) }
     |                                                                  ^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_RECV_CSCOV` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2577:23
     |
2577 |                 libc::DCCP_SOCKOPT_RECV_CSCOV,
     |                       ^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_RECV_CSCOV` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2591:66
     |
2591 |         unsafe { getsockopt(self.as_raw(), libc::SOL_DCCP, libc::DCCP_SOCKOPT_RECV_CSCOV) }
     |                                                                  ^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_QPOLICY_TXQLEN` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2605:23
     |
2605 |                 libc::DCCP_SOCKOPT_QPOLICY_TXQLEN,
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_QPOLICY_TXQLEN` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2623:23
     |
2623 |                 libc::DCCP_SOCKOPT_QPOLICY_TXQLEN,
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_AVAILABLE_CCIDS` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2645:19
     |
2645 |             libc::DCCP_SOCKOPT_AVAILABLE_CCIDS,
     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `DCCP_SOCKOPT_GET_CUR_MPS` in crate `libc`
    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.5.1/src/sys/unix.rs:2663:23
     |
2663 |                 libc::DCCP_SOCKOPT_GET_CUR_MPS,
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `socket2` due to 15 previous errors
mokeyish commented 1 year ago

105 这个 PR 先修复,禁用设备绑定了。这个库 https://github.com/rust-lang/socket2 居然有问题

不会再出现此类编译问题了,已经加了 #107 CI 检查,代码合并前,得通过这些检查。

PikuZheng commented 1 year ago
localhost:~/test# sh ./runquerypref.sh
DNS Performance Testing Tool
Version 2.11.1

[Status] Command line: dnsperf -p 53 -s 172.19.0.4 -d ./data/querytest_400W.txt
[Status] Sending queries (to 172.19.0.4:53)
[Status] Started at: Tue Apr  4 19:31:06 2023
[Status] Stopping after 1 run through file
^C[Status] Testing complete (interruption)

Statistics:

  Queries sent:         1683132
  Queries completed:    1683032 (99.99%)
  Queries lost:         0 (0.00%)
  Queries interrupted:  100 (0.01%)

  Response codes:       NOERROR 1683032 (100.00%)
  Average packet size:  request 31, response 62
  Run time (s):         6804.565230
  Queries per second:   247.338653

  Average Latency (s):  0.404254 (min 0.055399, max 3.820666)
  Latency StdDev (s):   0.339117

似乎无改善

Mem: 3855964K used, 174348K free, 48724K shrd, 109932K buff, 1062416K cached
CPU:   0% usr   0% sys   0% nic  99% idle   0% io   0% irq   0% sirq
Load average: 0.38 1.16 1.31 2/1000 247
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
   11     0 root     S     382m  10%   1   0% {smartdns-runtim} /usr/sbin/smartdns run -c /etc/smartdns/smartdns.conf -d -p -
   10     0 root     S     382m  10%   0   0% {smartdns-runtim} /usr/sbin/smartdns run -c /etc/smartdns/smartdns.conf -d -p -
    9     0 root     S     382m  10%   1   0% {smartdns-runtim} /usr/sbin/smartdns run -c /etc/smartdns/smartdns.conf -d -p -
    8     0 root     S     382m  10%   0   0% {smartdns-runtim} /usr/sbin/smartdns run -c /etc/smartdns/smartdns.conf -d -p -
    1     0 root     S     382m  10%   1   0% /usr/sbin/smartdns run -c /etc/smartdns/smartdns.conf -d -p -
  236     0 root     S     1692   0%   0   0% /bin/sh
  237   236 root     R     1620   0%   1   0% top -H

不过确实是四个线程了

PikuZheng commented 1 year ago

image 而且cpu使用增加了。。。就挺迷惑

mokeyish commented 1 year ago

无改善? 看你上面的意思你限制了4个线程?之前就是锁死了四个线程。

上面说 num-workers 4,只是示例可以这样控制线程数。不配置它才会使用所有 cpu。

PikuZheng commented 1 year ago

无改善? 看你上面的意思你限制了4个线程?之前就是锁死了四个线程。

上面说 num-workers 4,只是示例可以这样控制线程数。不配置它才会使用所有 cpu。

我2核,,,不配置就是2线程。那么配置4线程cpu使用量是30%,我改成16试了cpu使用量仍是30%,但确实是16个线程了。 但是无改善。每秒查询只有200左右。应该不是线程的问题。

他那个测试脚本是重复测www.baidu.com,原则上应该完全命中缓存。但是脚本运行时看到有5Mbps的入站流量,感觉似乎完全没有命中缓存。

mokeyish commented 1 year ago

那就奇怪了,为啥你电脑30%,cpu 利用率上不去难道卡在入站流量上了?

PikuZheng commented 1 year ago

105 这个 PR 先修复,禁用设备绑定了。这个库 https://github.com/rust-lang/socket2 居然有问题

不会再出现此类编译问题了,已经加了 #107 CI 检查,代码合并前,得通过这些检查。

rust-lang/libc 昨天发布0.2.141 release了说修复了编译问题

PikuZheng commented 1 year ago

看了一下上端路由器的状态。性能测试时连接数满(6万多),大概一半是icmp连接。可见是缓存完全没有命中,时间都耗费在查询和测速上了。带宽占用大概5Mbps。 另外开了debug日志也有影响。关掉后每秒查询量由200上升到300。

eqfae commented 1 month ago
localhost:~# dnsperf -s 10.0.0.1 -p 56 -d direct-list.txt -Q 40000 -c 10000
DNS Performance Testing Tool
Version 2.14.0

[Status] Command line: dnsperf -s 10.0.0.1 -p 56 -d direct-list.txt -Q 40000 -c 10000
[Status] Sending queries (to 10.0.0.1:56)
[Status] Started at: Wed Sep 18 06:16:13 2024
[Status] Stopping after 1 run through file
Warning: requested number of clients (-c 10000) per thread (-T) exceeds built-in maximum 256, adjusting

[Timeout] Query timed out: msg id 4570
Warning: received a response with an unexpected (maybe timed out) id: 4570
[Status] Testing complete (end of file)

Statistics:

  Queries sent:         90143
  Queries completed:    90142 (100.00%)
  Queries lost:         1 (0.00%)

  Response codes:       NOERROR 90142 (100.00%)
  Average packet size:  request 29, response 58
  Run time (s):         206.626054
  Queries per second:   436.256698

  Average Latency (s):  0.226143 (min 0.000743, max 3.159091)
  Latency StdDev (s):   0.357299

这个性能怎么说 发行版的编译解除了性能限制了吗? cpu是ipq6000 性能与r2s差不多

eqfae commented 1 month ago

路由器cpu没跑满

eqfae commented 1 month ago

Queries per second: 111.519395

Average Latency (s): 0.693119 (min 0.008895, max 4.657756) Latency StdDev (s): 0.473518 感觉上游dns有限速 Warning数量越来越多

Queries per second: 173.635693

Average Latency (s): 0.561858 (min 0.001413, max 4.971670) Latency StdDev (s): 0.555906

Queries per second: 98.943274

Average Latency (s): 0.749780 (min 0.007041, max 3.201713) Latency StdDev (s): 0.382289 这每次测试都换了dns 与之同时有拨号的现象 Queries per second: 609.503257

Average Latency (s): 0.163407 (min 0.022980, max 3.104559) Latency StdDev (s): 0.319474 表现最好的阿里 上面400+和这600+ 其他很多warn就停了 就这几个公共dns 也没别的选

eqfae commented 1 month ago

通过环境变量设置16线程(4倍cpu) 测试 cpu占用20%左右

mokeyish commented 1 month ago

@eqfae 你的测试结果看不懂,有什么不同?

不一定能跑满,比如没中缓存,上游响慢,他就是创建一个 future 仅仅是占内存,不计算的,会大量的 furue 积压

mokeyish commented 1 month ago

@eqfae 你感兴趣的话,能否建个做 DNS 性能评估的仓库呢?上面的测试,最早的那个,我之前看过,是同一个域名重复了好多万次,这模拟不了实际场景的查询,而且也会被缓存。

最好的测试是,首先可以自建 dnsmasq 作为上游,可负载均衡多个,保证都能及时响应,即上游用于都是可快速响应的;再来评估这个软件,不断增加并发数,看看是不是无法完全利用 CPU。

如果只是和 C 版对比,到简单,直接分别启动对比结果就是了。

eqfae commented 1 month ago

@eqfae 你感兴趣的话,能否建个做 DNS 性能评估的仓库呢?上面的测试,最早的那个,我之前看过,是同一个域名重复了好多万次,这模拟不了实际场景的查询,而且也会被缓存。

最好的测试是,首先可以自建 dnsmasq 作为上游,可负载均衡多个,保证都能及时响应,即上游用于都是可快速响应的;再来评估这个软件,不断增加并发数,看看是不是无法完全利用 CPU。

如果只是和 C 版对比,到简单,直接分别启动对比结果就是了。

每次测试重启了dns 为找出最快的 第一次是唯一跑完的 后续都没测完 各种报错 网络都断了重播 所以只发最后的结果 而且大数据已经给我推荐了dns都被限速的消息 评论很多说要迁出阿里 但我实测阿里给的限制才是最高的 quic 至少能跑完 别的 网都没了 root@OpenWrt:~# free total used free shared buff/cache available Mem: 954620 346964 536448 7908 71208 548500 Swap: 477180 29812 447368

dnsperf -s 10.0.0.1 -p 56 -d direct-list.txt -Q 40000 -c 10000 测试占用率就是百分之20 [Status] Command line: dnsperf -s 10.0.0.1 -p 56 -d direct-list.txt -Q 40000 -c 10000

Statistics:

Queries sent: 90143 Queries completed: 90142 (100.00%) Queries lost: 1 (0.00%)

Response codes: NOERROR 90142 (100.00%) Average packet size: request 29, response 58 Run time (s): 251.954211 Queries per second: 357.771357

Average Latency (s): 0.276291 (min 0.001056, max 4.381222) Latency StdDev (s): 0.372016

第二次

localhost:~# dnsperf -s 10.0.0.1 -p 56 -d direct-list.txt -Q 40000 -c 10000
Statistics:

  Queries sent:         90143
  Queries completed:    90142 (100.00%)
  Queries lost:         1 (0.00%)

  Response codes:       NOERROR 90142 (100.00%)
  Average packet size:  request 29, response 58
  Run time (s):         100.840916
  Queries per second:   893.903026

  Average Latency (s):  0.108756 (min 0.000471, max 3.233371)
  Latency StdDev (s):   0.302105

图片 图片 内存400不变 应该在缓存上 但cpu确实上不去 第三次 图片

[Status] Command line: dnsperf -s 10.0.0.1 -p 56 -d direct-list.txt

Statistics:

  Queries sent:         90143
  Queries completed:    90142 (100.00%)
  Queries lost:         1 (0.00%)

  Response codes:       NOERROR 90142 (100.00%)
  Average packet size:  request 29, response 58
  Run time (s):         101.561449
  Queries per second:   887.561185

  Average Latency (s):  0.109588 (min 0.000368, max 3.168325)
  Latency StdDev (s):   0.293653

同时我还有一个问题 就是手机www域名不解析 电脑没开v6没事 我也没测开v6的情况 我已经在路由器关闭了dhcpv6可手机还是有v6地址还不知道在哪关 我认为是手机执着访问v6 而v6禁用dns就给返回空地址出现的

eqfae commented 1 month ago

@eqfae 你感兴趣的话,能否建个做 DNS 性能评估的仓库呢?上面的测试,最早的那个,我之前看过,是同一个域名重复了好多万次,这模拟不了实际场景的查询,而且也会被缓存。

最好的测试是,首先可以自建 dnsmasq 作为上游,可负载均衡多个,保证都能及时响应,即上游用于都是可快速响应的;再来评估这个软件,不断增加并发数,看看是不是无法完全利用 CPU。

如果只是和 C 版对比,到简单,直接分别启动对比结果就是了。

你去找分流规则仓库 会有类似的 vscode 搜 $ 正则 替换' A'v4查询 direct-list.txt

eqfae commented 1 month ago

图片 adg 45 -60 然后下降到慢慢0

Statistics:

  Queries sent:         90143
  Queries completed:    90143 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 86706 (96.19%), SERVFAIL 1621 (1.80%), NXDOMAIN 1816 (2.01%)
  Average packet size:  request 29, response 67
  Run time (s):         83.245715
  Queries per second:   1082.854535

  Average Latency (s):  0.089255 (min 0.001231, max 3.308412)
  Latency StdDev (s):   0.306315

缓存满 图片


Statistics:

  Queries sent:         90143
  Queries completed:    90142 (100.00%)
  Queries lost:         1 (0.00%)

  Response codes:       NOERROR 86807 (96.30%), SERVFAIL 1514 (1.68%), NXDOMAIN 1821 (2.02%)
  Average packet size:  request 29, response 67
  Run time (s):         21.309564
  Queries per second:   4230.119396

  Average Latency (s):  0.023228 (min 0.000790, max 3.548228)
  Latency StdDev (s):   0.084078
eqfae commented 1 month ago

Statistics:

Queries sent: 1707 Queries completed: 1607 (94.14%) Queries lost: 0 (0.00%) Queries interrupted: 100 (5.86%)

Response codes: NOERROR 7 (0.44%), SERVFAIL 1600 (99.56%) Average packet size: request 28, response 28 Run time (s): 38.327131 Queries per second: 41.928523

Average Latency (s): 2.328057 (min 0.001021, max 2.405559) Latency StdDev (s): 0.175029

Statistics:

Queries sent: 707 Queries completed: 607 (85.86%) Queries lost: 0 (0.00%) Queries interrupted: 100 (14.14%)

Response codes: NOERROR 7 (1.15%), SERVFAIL 600 (98.85%) Average packet size: request 28, response 28 Run time (s): 15.154583 Queries per second: 40.053890

Average Latency (s): 2.311153 (min 0.000913, max 2.405137) Latency StdDev (s): 0.263971

原版这是怎么回事 通过opkg安装的 同时又开始重拨号了 同时smartdnsrs区别在于doh doq 这里把上游改为adg 已被缓存 图片


Statistics:

  Queries sent:         90143
  Queries completed:    90063 (99.91%)
  Queries lost:         80 (0.09%)

  Response codes:       NOERROR 86874 (96.46%), SERVFAIL 1372 (1.52%), NXDOMAIN 1817 (2.02%)
  Average packet size:  request 29, response 63
  Run time (s):         14.253308
  Queries per second:   6318.743691

  Average Latency (s):  0.011359 (min 0.000415, max 0.157542)
  Latency StdDev (s):   0.008038

Statistics:

  Queries sent:         90143
  Queries completed:    90120 (99.97%)
  Queries lost:         23 (0.03%)

  Response codes:       NOERROR 86927 (96.46%), SERVFAIL 1375 (1.53%), NXDOMAIN 1818 (2.02%)
  Average packet size:  request 29, response 63
  Run time (s):         4.764010
  Queries per second:   18916.836866

  Average Latency (s):  0.003865 (min 0.000323, max 0.007440)
  Latency StdDev (s):   0.000366
Statistics:

  Queries sent:         90143
  Queries completed:    90095 (99.95%)
  Queries lost:         48 (0.05%)

  Response codes:       NOERROR 86905 (96.46%), SERVFAIL 1373 (1.52%), NXDOMAIN 1817 (2.02%)
  Average packet size:  request 29, response 63
  Run time (s):         5.967936
  Queries per second:   15096.509078

  Average Latency (s):  0.004864 (min 0.000325, max 0.029987)
  Latency StdDev (s):   0.001149

图片 图片

Statistics:

  Queries sent:         90143
  Queries completed:    89926 (99.76%)
  Queries lost:         217 (0.24%)

  Response codes:       NOERROR 89926 (100.00%)
  Average packet size:  request 29, response 47
  Run time (s):         98.871413
  Queries per second:   909.524778

  Average Latency (s):  0.093277 (min 0.001028, max 1.104769)
  Latency StdDev (s):   0.078911
# 该数据很多Warning: received a response with an unexpected (maybe timed out) id: 38712可能有重拨号问题 重测
重测1
Statistics:

  Queries sent:         90143
  Queries completed:    90143 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 90143 (100.00%)
  Average packet size:  request 29, response 59
  Run time (s):         122.077593
  Queries per second:   738.407416

  Average Latency (s):  0.135002 (min 0.000998, max 1.484128)
  Latency StdDev (s):   0.087824
2
Statistics:

  Queries sent:         90143
  Queries completed:    90143 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 90143 (100.00%)
  Average packet size:  request 29, response 59
  Run time (s):         41.893424
  Queries per second:   2151.721950

  Average Latency (s):  0.046023 (min 0.000502, max 0.501811)
  Latency StdDev (s):   0.079823
3.
Statistics:

  Queries sent:         90143
  Queries completed:    90143 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 90143 (100.00%)
  Average packet size:  request 29, response 59
  Run time (s):         43.065296
  Queries per second:   2093.170334

  Average Latency (s):  0.047341 (min 0.000504, max 0.290676)
  Latency StdDev (s):   0.080995

见上面测试 这次可能是有10-20m内存系统没给他 adg可执行文件也在内存中 关闭可释放200左右内存 向adg请求拖慢了速度

Statistics:

  Queries sent:         90143
  Queries completed:    90143 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 90143 (100.00%)
  Average packet size:  request 29, response 59
  Run time (s):         34.573153
  Queries per second:   2607.312096

  Average Latency (s):  0.037902 (min 0.000520, max 0.294800)
  Latency StdDev (s):   0.072376

Statistics:

  Queries sent:         90143
  Queries completed:    90143 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 90143 (100.00%)
  Average packet size:  request 29, response 59
  Run time (s):         36.200245
  Queries per second:   2490.121269

  Average Latency (s):  0.039910 (min 0.000510, max 0.296078)
  Latency StdDev (s):   0.074465
mokeyish commented 1 month ago

@eqfae 这数据别人看不懂的,图例要说清楚什么条件测试的。

eqfae commented 1 month ago

@eqfae 这数据别人看不懂的,图例要说清楚什么条件测试的。

命令 dnsperf -s 10.0.0.1 -p 56 -d direct-list.txt -Q 40000 -c 10000 好像不加参数也不怎样 文件我也发出来了 你不找性能问题 质疑我测试准确性 我没必要伪造数据 只是闲的想找个最快的 adg还开了广告屏蔽 smartdns配置目前为

# https://pymumu.github.io/smartdns/configuration/
# 在本地 53 端口监听
# bind :54 -no-cache
bind [::]:54 -force-aaaa-soa -no-dualstack-selection -group cn
# -no-cache -force-aaaa-soa -no-dualstack-selection
# -no-rule-addr
bind [::]:55 -no-rule-addr -no-speed-check -group world
# bind [::]:54

cache-size 52428800
serve-expired yes
serve-expired-reply-ttl 3

# 禁用IPV6
# force-AAAA-SOA yes
# 设定过期缓存服务最长超时时间(秒) 0停用
serve-expired-ttl 0
# 强制指定 qtyp 返回 SOA
force-qtype-SOA 65

# log-level debug
# log-console yes
# 禁用日志
log-num 0

speed-check-mode tcp:443
response-mode fastest-ip
# 配置 bootstrap-dns,如不配置则调用系统的,建议配置,这样就加密了。
server https://1.1.1.1/dns-query -bootstrap-dns -exclude-default-group

# 配置国内上游服务器
# server-quic 223.5.5.5 -exclude-default-group -group cn
server https://223.5.5.5/dns-query -exclude-default-group -group cn
# 配置互联网上游服务器
server https://1.1.1.1/dns-query -exclude-default-group -group world

# 以 ofc 结尾的域名转发至 office 分组进行解析
# nameserver /ofc/office
# 设置域名的静态 IP
# address /test.example.com/1.2.3.5
# 自定义屏蔽
address /high-logic.com/#

# 屏蔽域名(广告屏蔽) 源自adg统计数据前列
address /aeventlog.beacon.qq.com/#
address /dataflow.biliapi.com/#
address /apd-pcdnwxlogin.teg.tencent-cloud.net/#
address /tmead.y.qq.com/#
address /apd-pcdnwxstat.teg.tencent-cloud.net/#
address /onrt-stsdk.vivo.com.cn/#
address /svideopnrt-stsdk.vivo.com.cn/#
address /svideoonrt-stsdk.vivo.com.cn/#
address /hdns.ksyun.com/#
address /apd-pcdnwxnat.teg.tencent-cloud.net/#
address /httpdns.c.cdnhwc2.com/#
address /httpdns.bcelive.com/#
address /svideoprt-stsdk.vivo.com.cn/#
address /dig.bdurl.net/#
address /adashbc.ut.taobao.com/#
address /teams.events.data.microsoft.com/#
address /umengacs.m.taobao.com/#
address /dns.weixin.qq.com.cn/#
address /android.bugly.qq.com/#
address /log.tbs.qq.com/#
address /sdkoptedge.chinanetcenter.com/#
address /slb-p2p.vcloud.ks-live.com/#
address /videoplayonrt-stsdk.vivo.com.cn/#
address /mon.zijieapi.com/#
address /wxsnsencsvp.wxs.qq.com/#
address /svideoort-stsdk.vivo.com.cn/#
address /otheve.beacon.qq.com/#
address /vi.bls.mdt.qq.com/#
address /adash.man.aliyuncs.com/#
address /h.trace.qq.com/#
address /ort-stsdk.vivo.com.cn/#
address /gdfp.gifshow.com/#
address /api-access.pangolin-sdk-toutiao1.com/#
address /mssdk.volces.com/#
address /adxlog.vivo.com.cn/#
address /ks.pull.yximgs.com/#
address /tx-ad.a.yximgs.com/#
address /ali-ad.a.yximgs.com/#
address /amdcopen.m.taobao.com/#
address /api-access.pangolin-sdk-toutiao.com/#
address /conn-service-cn-03.allawntech.com/#
address /www.pangolin-dsp-toutiao.com/#
address /log.zijieapi.com/#
address /als.baidu.com/#
address /adlog.vivo.com.cn/#
address /ulogs.umeng.com/#
address /brpnrt.stsdk.vivo.com.cn/#
address /applog.zijieapi.com/#
address /wn.pos.baidu.com/#
address /wxsnsdythumb.wxs.qq.com/#
address /appstoreort-stsdk.vivo.com.cn/#
address /conn-service-cn-04.allawntech.com/#
address /conn-service-cn-05.allawntech.com/#
address /tracking.miui.com/#
address /tools.3g.qq.com/#
address /api3.tuisong.baidu.com/#
address /stsdk.vivo.com.cn/#
address /snowflake.qq.com/#
address /hm.baidu.com/#

address测试时注释了 二者区别只在于doh doq

eqfae commented 1 month ago

这是现在用的配置 当时54绑在adg上 你改56就是了