New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the possibility to shuffle NameServers #1920
Conversation
Hello, this PR makes it possible to shuffle DNS NameServers to avoid overloads to the first configured ones. The default value for `shuffle_dns_servers` is set to true, it greatly improves performance in all kinds of tasks so IMO it makes sense to default to it. For comparison: A lookup for 11500 hosts, having 1000 resolvers, and using 100 threads takes ~10 minutes to complete, with this change it only takes 55 seconds. That means ~10x of performance increase. It's the continuation of hickory-dns#1632, I have tried implemeting `SmallRng`, however I haven't had success because it doesn't implement `Send` and therefore can't be send between threads safely. It can be improved in the future, but for now I think that it's a good start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, nice and simple, adds exactly what I would think of for this feature without too much over head. Thanks for the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making that change. Looks good to me.
@djc, I'm going to merge this unless you have concerns. |
oops, I dropped the ball on this. @Edu4rdSHL , do you think you would mind rebasing this? |
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This commit updates the Rustls dependency to the recently released 0.21.0 tag, and to update tokio-rustls to 0.24.0 to use the same rustls release. It also updates webpki-roots to 0.23.0, and to use rustls' fork of webpki instead of the original. A couple of small upstream API changes are addressed to ensure the build and tests pass.
@bluejekyll done. |
Sorry for the delay. Thank you for the PR! |
Hello, this PR makes it possible to shuffle DNS NameServers to avoid overloads to the first configured ones.
The default value for
shuffle_dns_servers
is set to true, it greatly improves performance in all kinds of tasks so IMO it makes sense to default to it. For comparison:A lookup for 11500 hosts, having 1000 resolvers, and using 100 threads takes ~10 minutes to complete, with this change it only takes 55 seconds. That means ~10x of performance increase.
It's the continuation of #1632, I have tried implemeting
SmallRng
, however I haven't had success because it doesn't implementSend
and therefore can't be send between threads safely.It can be improved in the future, but for now I think that it's a good start.