| Bram Cohen ( @ 2005-11-11 11:40:00 |
Estimated Time Left
It turns out that estimating time left to complete a download is non-trivial. What BitTorrent currently does (simplifying a little) is to average total download over total time for the first half of the file, then for the second half of the file to update estimated time left as each piece comes in by assuming that the amount of download averaged over for the current estimate is equal to the amount of download left. This approach gives a fairly reasonable estimated time left under almost all circumstances, but it has a significant artifact.
The problem comes up when what was a very unstable download rate suddenly becomes a steady download rate. Frequently after that the estimated time left will drop at a predictable rate of, say, two seconds per second. A certain amount of this is totally unavoidable. The download rate may change to something else, and then the estimated time left might be totally reasonable or start creeping back up again. The problem is that the dropping tends to happen continuously, all the way to the end of the download. It would be far more preferable for the rate of dropping to be somewhat higher, and then after, say, 25% of the remainder has been downloaded, to have the estimated time left basically nailed and drop at a nice clean rate of one second per second. The amount of time it takes for the estimated rate to get accurate should probably be a parameter to the algorithm, settable at somewhere between 0% and 100%, which can be set based on whatever seems to be most psychologically reassuring for the users of the given application. Note that having this property probably makes the estimated time left less accurate from the point of view of placing bets on when the download will complete, but considerably nicer to watch go down as the download progresses.
If anyone can figure out an estimated time left algorithm which fulfills this criterion, and doesn't have any nasty artifacts I would greatly appreciate it.
It turns out that estimating time left to complete a download is non-trivial. What BitTorrent currently does (simplifying a little) is to average total download over total time for the first half of the file, then for the second half of the file to update estimated time left as each piece comes in by assuming that the amount of download averaged over for the current estimate is equal to the amount of download left. This approach gives a fairly reasonable estimated time left under almost all circumstances, but it has a significant artifact.
The problem comes up when what was a very unstable download rate suddenly becomes a steady download rate. Frequently after that the estimated time left will drop at a predictable rate of, say, two seconds per second. A certain amount of this is totally unavoidable. The download rate may change to something else, and then the estimated time left might be totally reasonable or start creeping back up again. The problem is that the dropping tends to happen continuously, all the way to the end of the download. It would be far more preferable for the rate of dropping to be somewhat higher, and then after, say, 25% of the remainder has been downloaded, to have the estimated time left basically nailed and drop at a nice clean rate of one second per second. The amount of time it takes for the estimated rate to get accurate should probably be a parameter to the algorithm, settable at somewhere between 0% and 100%, which can be set based on whatever seems to be most psychologically reassuring for the users of the given application. Note that having this property probably makes the estimated time left less accurate from the point of view of placing bets on when the download will complete, but considerably nicer to watch go down as the download progresses.
If anyone can figure out an estimated time left algorithm which fulfills this criterion, and doesn't have any nasty artifacts I would greatly appreciate it.