[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#274241: aptitude: download progress bar cannot handle variable throughput



On Thursday 30 September 2004 06:08 pm, Nikolaus Schulz wrote:
> > and so naturally if nothing is being
> > downloaded for long periods of time it'll say "stalled".  I consider this
> > a feature.
>
> If it's a feature, it should catch the traffic peaks, but it doesn't.
> Probably it just doesn't poll the traffic load often enough.

  You have it backwards: you're asking for apt to recalculate this information 
*less* often (or to keep a more detailed history).  What's happening is that 
apt notices that no data was received in the last 6 seconds, and then reports 
that.  The formula is (amount of data received in 6 seconds)/(time since last 
update).

  This could be smoothed out by making the interval longer, but it would mean 
that you get a less current value.  Another option is to use some sort of 
exponential decay (do a weighted average with the previous value), but that's 
more complicated and means you have to figure out some sort of threshold 
below which the download is considered "stalled".  You could also use a 
moving window (keep a circular queue of the data rate seen in, say, 10 
6-minute slices) and take the average of those samples (weighted by the 
legnth of the slice, of course).  This method has the serious drawback that 
it would change the apt ABI, since you'd have to add the queue to the 
pkgAcquireStatus object (thus changing its size).

  And in the end, any of these methods will still miss "bursty" transmissions 
of the type you describe; all they do is increase the interval within which 
data must arrive.  ie, no matter how big you make the window, someone can 
still have a connection that doesn't send any data within the window (and it 
sounds like apt-proxy would trigger any interval, if it downloads entire 
files before streaming them to clients).

  The only reasonable thing that can change (IMO) is to increase the interval 
over which apt calculates data rates and maybe to use an exponential-decay 
technique, and you can negotiate with the apt maintainers about that. 
(personally, I think that simply increasing the interval will make the 
progress indicator too insensitive to variations in the transfer rate)

  Daniel

-- 
/------------------- Daniel Burrows <dburrows@debian.org> ------------------\
|            "Fluble, the others want you to know that we                   |
|             have you surrounded with tranquilizer rifles                  |
|             and are prepared to use them.  Again."  -- Fluble             |
\---------------- The Turtle Moves! -- http://www.lspace.org ---------------/

Attachment: pgpb9hElWXUaS.pgp
Description: PGP signature


Reply to: