AdguardTeam / AdguardTeam/AdGuardHome
Drop / Stop queries after configurable timeout
- 主要言語
- TypeScript
- スター
- 36.9k
- フォーク
- 2.5k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Have a question or an idea? Please search it [on our forum](https://github.com/AdguardTeam/AdGuardHome/discussions) to make sure it was not yet asked. If you cannot find what you had in mind, please [submit it here](https://github.com/AdguardTeam/AdGuardHome/discussions/new).
### Prerequisites
Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**
- [x] I am running the latest version
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed
### Problem Description
When AdGuard is running on a quite slow machine like a Raspberry PI and a lot of DNS-Resolvers are configured and there are a lot of DNS requests AdGuard fills up a internal queue and so slowing down everything even more.
### Proposed Solution
There is a configurable timeout like 5 seconds. If queries are not answered / processed within this interval they are dropped.
### Alternatives Considered
### Additional Information
To reproduce this problem:
Configure AdGuard as DNS-Server on Raspberry PI Zero W with these resolvers
```
tls://dot.ffmuc.net
tls://dns.digitale-gesellschaft.ch
tls://unicast.uncensoreddns.org
tls://dot1.applied-privacy.net
tls://dns3.digitalcourage.de
```
Now go to https://browserleaks.com/dns and start the test.
Watch at the CPU and try to do a dnsquery in parallel like `ping heise.de`

This is the log what happened. I did a ping to idealo.de
It took 5 seconds until request was answered. In the meantime windows was repeating the request. AdGuard did queue all these requests and they took 13, 14 and even 54 (!) seconds to complete.
After a timeout of about 5 seconds request won't be processed anymore so you can drop it.
Also it makes sense to have a queue "running requests" so that if another dns request for the same name comes in AdGuard sees that it is already processing and thus waiting for the first result to arrive and then serve the answer from the cache. Screenshot from above indicates that if the same request comes in and isn't in cache it is forwarded to upstream multiple times.
PS: Limit of maximum 20 queries per second and client is still set.
コントリビューションガイド
評価
この issue はまだ評価されていません。