cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Time spent in ares_init_options

From: Paul Oliver <puzza007_at_gmail.com>
Date: Thu, 16 Jul 2015 08:26:01 +0000

It looks as if it's this
https://github.com/bagder/c-ares/blob/bba4dc573f5c31b0145d09aa2c245e94896cf1df/ares_init.c#L1908.
I can't seem to find a way of doing it globally...

My /etc/hosts is 9 lines ;}

On Wed, Jul 15, 2015 at 11:36 PM Gisle Vanem <gvanem_at_yahoo.no> wrote:

> Paul Oliver wrote:
>
> > I've written a libcurl application based on the hiperfifo example and
> have run into something I'm unsure about. I have
> > a test that kicks off requests to around 9K distinct URLs concurrently.
> It seems that ~75% of time during this test is
> > spent inside ares_init_options. Is this expected behaviour? I've
> called curl_global_init at the start of main. Is
> > there anything I'm missing?
> >
> > Here's a screenshot of the trace:
> https://www.dropbox.com/s/zghmckkrnj10qov/Screenshot%202015-07-15%2021.05.57.png?dl=0
>
> It looks like it opens and fread() your /etc/hosts file
> many times. Do you have a large hosts file?
> There must be a way to do this only once.
>
> --
> --gv
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-07-16