curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Repeated calls to ares_init when using c-ares

From: Jeff Mears via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 28 Jan 2020 20:54:38 +0000

When using c-ares for async DNS, every time curl_easy_init is called, libcurl calls ares_init via Curl_resolver_init. In an environment with many requests being done using the "multi" interface, this is slow.

ares_init does things like read /etc/resolv.conf and initializing big arrays. It's enough that ares_init is showing up in CPU usage profiles.

Is there a way for libcurl to use one instance of c-ares, rather than trying to create one for every curl_easy_init?

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-01-28