curl-library
Re: Changing upload speed while a transfer is active
Date: Thu, 22 Jan 2009 13:17:41 +0100 (CET)
On Thu, 22 Jan 2009, Yoav Steinberg wrote:
> The problem is that since throttling is calculated based on cumulative
> average during the entire transfer, the result of changing the speed limit
> during a transfer is that we get a few seconds of no transfer at all when
> reducing the limit or a few seconds of unlimited transfer speed when
> increasings the limit. This leads to other problems like the connection
> dying because of no transfer when reducing the speed.
>
> To solve this I guess I'll need to change the speed calculation based on
> some sliding window average and not based on the entire transfer. Before I
> start playing around with the transfer speed calculation code to achieve
> this, I'd like to know why a cumulative average approach was chosen in the
> first place.
I think we did it that way simply because it was simple and not too wrong.
I would agree that a sliding window probably is a better approach, and in case
you want to change the speed limitation in the middle it'd be more or less
required.
-- / daniel.haxx.seReceived on 2009-01-22