curl / Mailing Lists / curl-library / Single Mail


Re: [curl/curl] 04b61f: progress: fix rate-limit for high speed transfers

From: Daniel Stenberg <>
Date: Wed, 21 Mar 2018 00:14:51 +0100 (CET)

On Tue, 20 Mar 2018, Ben Greear wrote:

>> This new logic updates the rate limit "window" to be no shorter than the
>> last three seconds and only updating the timestamps for this when
>> switching between the states TOOFAST/PERFORM.
> As far as I can tell, this patch is broken. I am downloading a 20MB file
> using ftp, with a program compiled against lib-curl. With this patch,
> download spikes to 150Mbps (or probably higher, depending on resolution),
> and then has a long pause for the next URL (that pause might be caused by my
> own rate-ctrl across URLs).

Yeah, this fix basically reversed the problem and was subsequently filed, although
phrased more like a discusssion.

I think I need to backpedal a bit and make the period to check be something
like 500 milliseconds or something. At least not longer than a second I think.

> And/or, what speed showed the previous problem you are trying to fix?

The previous problem was that for high speed transfers on for example
localhost, it could do the second check the same millisecond as the previous
which made the delta time to be zero, thus not limiting it at all.

Zero was wrong and 3000 milliseconds is wrong in the other direction...

Received on 2018-03-21