smartdns icon indicating copy to clipboard operation
smartdns copied to clipboard

response-mode 功能问题?

Open PikuZheng opened this issue 3 years ago • 9 comments

问题现象

  1. #991 之前配置 response-mode whole-response 新版已经不支持了。但实测无论配置成哪个选项(first-ping, fastest-ping, fastest-response), 1.1 在开启缓存时,首次查询只返回 1 个ip,之后查询只返回 5 个ip(预期6个) 1.2 在关闭缓存时,无论如何配置只能返回 1 个ip(预期6个)

要返回包含最快IP结果的完整结果(即旧版whole-response),应该如何配置?

  1. 当配置测速为tcp时,设置response-mode first-ping,事实上会使用tcp测速还是ping测速?

  2. #990 当开启缓存时,max-reply-ip-num 配置为大于5的任何值,最多只返回5个ip 当启用缓存并配置 response-mode fastest-response 时,首次查询返回6个,之后查询只返回 5 个ip

PikuZheng avatar Jul 31 '22 09:07 PikuZheng

[2022-07-31 09:42:29,322][DEBUG][     dns_client.c:1616] domain: message.bilibili.com qtype: 1  qclass: 1
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2757] query result from server 120.53.53.53:443, type: 3
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2415] name: message.bilibili.com ttl: 81 cname: a.w.bilicdn1.com
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2226] domain: a.w.bilicdn1.com TTL: 71 IP: 218.60.18.15
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2226] domain: a.w.bilicdn1.com TTL: 71 IP: 218.60.18.16
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2226] domain: a.w.bilicdn1.com TTL: 71 IP: 218.60.18.17
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2226] domain: a.w.bilicdn1.com TTL: 71 IP: 218.60.18.18
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2226] domain: a.w.bilicdn1.com TTL: 71 IP: 218.60.18.13
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:2226] domain: a.w.bilicdn1.com TTL: 71 IP: 218.60.18.14
[2022-07-31 09:42:29,322][DEBUG][     dns_client.c:1394] result: message.bilibili.com, qtype: 1, hasresult: 1, id 13
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:1345] reply message.bilibili.com qtype: 1, rcode: 0, reply: 1
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:692 ] result: message.bilibili.com, rtt: 7.3 ms, 218.60.18.14
[2022-07-31 09:42:29,322][ INFO][     dns_server.c:559 ] result: message.bilibili.com, id: 0, index: 1, rtt: 7.3 ms, 218.60.18.14
[2022-07-31 09:42:29,322][ INFO][     dns_server.c:559 ] result: message.bilibili.com, id: 0, index: 2, rtt: 8.1 ms, 218.60.18.18
[2022-07-31 09:42:29,322][ INFO][     dns_server.c:559 ] result: message.bilibili.com, id: 0, index: 3, rtt: 7.5 ms, 218.60.18.16
[2022-07-31 09:42:29,322][ INFO][     dns_server.c:559 ] result: message.bilibili.com, id: 0, index: 4, rtt: 7.4 ms, 218.60.18.15
[2022-07-31 09:42:29,322][ INFO][     dns_server.c:559 ] result: message.bilibili.com, id: 0, index: 5, rtt: 7.3 ms, 218.60.18.17
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:933 ] cache message.bilibili.com qtype:1 ttl: 33
[2022-07-31 09:42:29,322][DEBUG][     dns_server.c:1066] Cache CNAME: a.w.bilicdn1.com, qtype: 1, speed: 73

为啥6个结果只返回5个啊(配置max-reply-ip-num 大于5

PikuZheng avatar Jul 31 '22 09:07 PikuZheng

这个是最大值,不是说一定返回那么多

pymumu avatar Jul 31 '22 11:07 pymumu

这个是最大值,不是说一定返回那么多

~观察了几次,发现返回的ip数量总是比上游获得的数量少1~ 我已经糊涂了,相同版本相同配置,在openwrt,上游6个返回6个;在docker上游6个返回5个

PikuZheng avatar Jul 31 '22 11:07 PikuZheng

whole-response没有想清楚,并且效果也没分析清楚。

max-reply-ip-num只对cache数据有效。 那三个模式: first-ping:第一次返回一个IP,无论什么测速模式。 fastest-ip: 第一次返回一个IP。 fastest-response : 返回IP数量看上有结果,等价测速模式配置为none的时候。

pymumu avatar Aug 01 '22 01:08 pymumu

fastest-response : 返回IP数量看上有结果,等价测速模式配置为none的时候。

这解释不了上游6个返回5个的情况啊(见二楼日志)

PikuZheng avatar Aug 01 '22 13:08 PikuZheng

没命中缓存,到上游查询,上游返回6个,这六个返回客户端,同时缓存存储5个,下次查询后返回5个

pymumu avatar Aug 01 '22 14:08 pymumu

也就是说在写入缓存时只写了5个。有什么方法能检查当前缓存数量,看是不是缓存满了?

PikuZheng avatar Aug 01 '22 23:08 PikuZheng

@pymumu response-mode的参数是不是又更新了 fastest-ping还是fastest-ip

openips avatar Aug 06 '22 12:08 openips

fastest-ip

pymumu avatar Aug 06 '22 12:08 pymumu