curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: DNS Lookup time (CURLINFO_NAMELOOKUP_TIME) performs worse than getaddrinfo()

From: Philip Prindeville <philipp_subx_at_redfish-solutions.com>
Date: Tue, 26 Jun 2018 18:52:47 -0600

> On Jun 25, 2018, at 3:15 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Mon, 25 Jun 2018, Bernhard Jaeger wrote:
>
>> But this data are from two different programs so it would be very helpful to have an additional timestamp within licurl to see if the initialisations are what really makes the difference here. Would it be possible to have that feature on a new branch?
>
> I created a PR at https://github.com/curl/curl/pull/2683 with such an additional time-stamp, but in my tests that time-stamp tends to be in the sub 100 microsecond range...
>
> $ ./src/curl -sw '%{time_namelookup_start} %{time_namelookup}\n' https://www.haxx.se -o /dev/null
> 0.000072 0.004239
>
>> Unfortunately I don't know what the threaded resolver backend is.
>
> curl can be built to use one of three different ways to resolve host names:
>
> 1. the threaded resolver (runs getaddrinfo in a separate thread) - default
> 2. the synchronous name resolver (using getaddrinfo directly)
> 3. c-ares
>

Just pointing out that libevent provides evdns_getaddrinfo() as an asynchronous resolution API with a callback, so if you’re linking with libevent you have a fourth choice (potentially).

It doesn’t provide reciprocal getnameinfo() rDNS service, but I might be adding that in the next few weeks…

-Philip

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-06-27