curl-library
weird timings from curl_easy_getinfo
Date: Thu, 19 Jul 2001 15:49:06 +0300 (GMT)
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/
Received on 2001-07-19