cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: transfer speed control

From: <RBramante_at_on.com>
Date: Tue, 22 Oct 2002 10:44:36 -0400

It's not really libcurl telling the server, it is TCP itself. TCP's
windowing mechanism is used for this type of purpose. Higher level
protocols like ftp have no intelligece about it, they rely on TCP to deal
with these issues. libcurl is only suggesting the initial window size to
the TCP stack via the buffer size option.

TCP uses an alogrithm called "slow start" which I believe deals with the
last question you ask regarding the server sending out an initial load of
data. Again, I am not an expert, but I think slow start is implemented to
prevent this situation, i.e. TCP ramps up the transmission until it thinks
it has found its sweet spot, so your connection should not get completely
inundated with data during the first stages of transmission.

                                                                                                                                       
                      Vincent Penquerc'h
                      <vincent.penquerch_at_artworks.c To: curl-library_at_lists.sourceforge.net
                      o.uk> cc:
                      Sent by: Subject: Re: transfer speed control
                      curl-library-admin_at_lists.sour
                      ceforge.net
                                                                                                                                       
                                                                                                                                       
                      10/22/2002 10:27 AM
                      Please respond to
                      curl-library
                                                                                                                                       
                                                                                                                                       

On Tue, Oct 22, 2002 at 10:16:26AM -0400, RBramante_at_on.com wrote:
>
> Go back and see CURLOPT_BUFFERSIZE and set the recv buffer to a smaller
> size if you are concerned with the amount of data the remote is sending.
> If supported by the underlying stack, this will lower the advertised TCP
> window. By advertising a smaller window, you should be automatically
rate
> limiting the sender. If you delay your reads, then the recv buffer will
> fill up sooner and the window will drop, causing the sender to backoff,
so
> your concerns about excessive buffering, etc. should be unfounded. Rick
> Jones can probably give us a better technical explanation based on his
> excellent response in the "How to set the size of the send buffer"
thread,
> but I think this is basically correct in layman's terms.

I see, thanks for the explanation. You mean that, if I don't actually
read the data, then libcurl will say so to the server, am I right ?
It seemed a bit odd to me, as it basically means that, if there is a
long round trip delay between client and server, then the server will
have possibly sent out a load of data before receiving any notification
that the client is full. Unless protocols always wait for a packet ack
before sending a second one ? I thought they didn't. But then I know
pretty much nothing of protocols, so...
Cheers

--
Vincent Penquerc'h
-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ad.doubleclick.net/clk;4699841;7576301;v?http://www.sun.com/javavote
Received on 2002-10-22