cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Re: weird timings from curl_easy_getinfo

From: <rnet_north\tbharath_at_mail.responsenetworks.com>
Date: Sat, 21 Jul 2001 12:28:56 -0400

Daniel ,the maintainer of Curl is on vacation
Maybe when he returns will give some insight on this

Bharath

Original Message:
-----------------
From: Oleg Bartunov oleg_at_sai.msu.su
Date: Sat, 21 Jul 2001 17:06:33 +0300 (GMT)
To: curl-library_at_lists.sourceforge.net
Subject: Re: weird timings from curl_easy_getinfo

Seems this list is quite dead :-)

Anyway, I dod some experiment with pthread_mutex_lock/pthread_mutex_unlock
and found that indeed libcurl isn't thread-safe.
When I lock curl_easy_perform and output I got right numbers but I
lost all benefits from using thread ! Something is wrong in progress.c -
different threads could interfere.

        Oleg

On Thu, 19 Jul 2001, Oleg Bartunov wrote:

> Hi,
>
> I wrote a simple multithreading program using libcurl 7.8 (Linux 2.2.19,
> Slackware 7.1) to get some statistics from retrieving a bunch of URLs
> and collecting timings (CURLINFO_TOTAL_TIME,CURLINFO_NAMELOOKUP_TIME,
> CURLINFO_CONNECT_TIME,CURLINFO_PRETRANSFER_TIME).
> My program is a modification of multithread.c I found in examples.
> I start 100 threads and program runs ok except timings look very strange -
> unreal, too big numbers very different from that I get using
> command line curl. Interesting that first 1-3 results look ok,
> but then numbers quickly become unreal.
>
> Here is a sample output (format is wrapped):
> CURLINFO_EFFECTIVE_URL|CURLINFO_FILETIME|CURLINFO_HTTP_CODE|
> CURLINFO_TOTAL_TIME|CURLINFO_NAMELOOKUP_TIME|CURLINFO_CONNECT_TIME|
> CURLINFO_PRETRANSFER_TIME|CURLINFO_SIZE_DOWNLOAD|CURLINFO_SPEED_DOWNLOAD
>
>
> http://0-alina.newmail.ru:80/|994846147|200|0.330|0.081|0.096|0.096|7227|6810.456
> http://0-alina.nm.ru:80/|994179061|200|0.408|0.104|0.118|0.119|7028|5083.553
> http://0-amateur.newmail.ru:80/|974821184|200|0.442|0.193|0.298|0.298|1486|2631.880
> http://0.dol.ru:80/|0|000|0.000|5.880|0.000|0.000|0|0.000
> http://0-freepix.newmail.ru:80/|0|200|6.174|5.666|5.882|5.882|1195|193.551
> http://000-amateur.newmail.ru:80/|0|200|6.616|6.397|6.468|6.468|1197|180.937
> http://0.dol.ru:8080/|0|000|6.834|6.026|6.238|6.238|0|0.000
> http://080.spb.ru:80/|200|51.533|42.230|51.291|51.292|858|16.650
>
> curl -K ./CONF http://080.spb.ru:80/
>
> http://080.spb.ru:80/|0|200|0.288|0.171|0.195|0.195|858|2982.087
>
> I tried from several hosts but the problem remains. Also, I don't
> understand connection between CURLINFO_TOTAL_TIME and other timings.
> I've seen CURLINFO_TOTAL_TIME < CURLINFO_NAMELOOKUP_TIME
> http://1.by.ru:80/|0|404|49.244|48.604|48.744|48.744|9335|54.746
> In my naive understanding CURLINFO_TOTAL_TIME must be a sum of all
> other timings.
>
> I could post my program - its' just 2.3 Kb tar.gz, if anyone want
> to see and test. Does libcurl is really thread-save ?
>
> Regards,
> Oleg
> _____________________________________________________________
> Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
> Sternberg Astronomical Institute, Moscow University (Russia)
> Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
> phone: +007(095)939-16-83, +007(095)939-23-83
>
>
> _______________________________________________
> Curl-library mailing list
> http://curl.haxx.se/libcurl/
>

        Regards,
                Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

_______________________________________________
Curl-library mailing list
http://curl.haxx.se/libcurl/

--------------------------------------------------------------------
Mail2Web - Check your email from the web at
http://www.mail2web.com/ .

_______________________________________________
Curl-library mailing list
http://curl.haxx.se/libcurl/
Received on 2001-08-02