cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Please advise on how to improve libcurl HTTP GET performance

From: Alan Wolfe <alan.wolfe_at_gmail.com>
Date: Mon, 10 Oct 2011 09:15:47 -0700

Without seeing the code, 2 things come to mind

#1 - Does your program block at all on disk i/o (are you reading or writing
to the disk?) if so that could be bottlenecking your D/L.
#2 - Are you sure the problem is on your end, not the server side?

If you show us your code we can probably help a little better. Also if you
tell us what sort of speeds you are getting that could be helpful.

Also an interesting test might be to connect to one of these sites with a
raw socket and send the commands needed to pull down one of these pieces of
data and measure the speed that way. Alternately, you could use a telnet
client and do the same thing. That can help you distinguish if libcurl /
your code is preforming optimally or not. (see
http://support.microsoft.com/kb/279466 or
http://forum.weborum.com/index.php?showtopic=2252)

On Mon, Oct 10, 2011 at 5:11 AM, Alex <Alexxxx89_at_ya.ru> wrote:

> Greetings!
> I'm trying to download web-pages. Everything works fine, except for low
> speed. I have 3 mbps connection (and I have disabled all other
> network-related programs), but I only get 30-40 KB/s in debug build, and
> even less (18-30 KB/s) in release build, and that's not the kind of speed I
> was hoping for. I've performed tests with several html pages ranging in size
> from 12 KB to 4.6 MB. The DNS lookup time is included into the time I've
> measured to determine speed, but it's very small in relation to the time
> needed for downloading 4.5 MB page.
> I can only think of two way of improving performance:
> - multithreading - multiple curl_easy_perform, each in it's own thread. Not
> a great solution - I will need 10-12 threads to utilize my relatively slow
> channel. For 100 Mbps I'll need 30 threads - quite too many, in my opinion,
> I'll spend mre time synchronizing them than executing them;
> - download multiple simultaneous fragments - if server has Accept-Ranges
> attribute, one could split download into several independent sections. Is
> there support for this feature in libcurl?
> Please excuse my (most likely) silly question, I'm new to libcurl and I'm
> sure I am missing something. If you can think of a way to squeeze more
> performance from libcurl - please advise.
>
> Thanks in advance!
>
> Alex.
> -------------------------------------------------------------------
> 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 2011-10-10