Closed aohan237 closed 5 years ago
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 trust-dns-resolver
and on first lookup it is going to take a while to build its caches
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. https://actix.rs/actix-web/actix_web/client/struct.ClientConnector.html#method.resolver
I had some ideas for changing time, but I didn't have time to work on it.
it is very slow on first, what's the cause you decided to use that?
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 IP address
and add Host
Http header when send request. It works perfect if you have only few domains to request and can ensure the IP address of requested domain won't change.
@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.