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
actix::client first request extremely slow unless you put a static dns in hosts #599
Comments
or actix has a inner dns loopup function,which use a different dns lookup server rather than a local dns server? |
I also noticed that https is much slower than http |
Actix uses |
can I disable it ,just use local dns? |
it is very slow on first, what's the cause you decided to use that? |
Not at the moment, it would require changing the way actix-web uses connector to allow custom one. I had some ideas for changing time, but I didn't have time to work on it.
It is async |
@aohan237 my new PR will allow you to provide address of your own resolver, you'd need to implement own actor that could handle https://actix.rs/actix/actix/actors/resolver/struct.Connect.html |
Actually, you should ask trust-dns author how to fix this problem |
I'm actually not sure if it possible to fix per se, you just need to build DNS cache before making requests, but rising issue on this problem would be good idea |
Yes it's really slow, takes about 1 minute for first request on my environment. |
still really slow now. |
@damody I have a workaround for my situation: Create request builder with |
@tuxzz thank you, I will try. |
it may be the dns issue. yes,if you put a static dns in hosts. it will be normal.
but other tools, such as curl will not have the problem. why?
url: https://cn.bing.com
curl is normal.but in actix::client ,is extremely slow
it will wait for about 5sec, until it get the first response.
The text was updated successfully, but these errors were encountered: