1

I've been downloading files from some services that offers hosting. Very often, when I download as a free user Firefox (other browsers as well, haven't checked all, though) shows me that download speed is 400KB and 10 minutes remaining to the finish. This is BS, because it takes 45 minutes or more to download file and e.g. "1 minute 40 seconds remaning" is shown for a few seconds.

The present the user a higher speed. How do they do that? Is this HTTP protocol cheat or browser cheat? Why does Firefox show the wrong value?

4

3 回答 3

2

我从来没有经历过这种情况,但是我再一次从不使用 Firefox 下载文件。

也就是说,远程服务器可能会以高速发送文件,但会以短时间突发的数据平均达到其“免费用户”的速度。Firefox 可能会看到在这些突发期间下载数据的速度,而不是整体平均速度。

于 2012-04-10T20:43:03.147 回答
-2

Many progress bars exist simply to make you feel better. For something like downloading a file, it is very difficult to estimate exactly.

How many packets get dropped and resent? What if bandwidth gets choked somewhere between your machine and the server? How much data needs to be sent? (for a file download, you could sent metadata first, but this can get complicated in many cases for many reasons).

These are all questions that are difficult or impossible to answer exactly, and they can be problematic to guess.

Bring in the idea that users Don't perceive download times accurately anyway, and the prospect of implementing an accurate progress bar is very unattractive. The easy way out is to make a progress bar that lies. Even the best implementations are just continuously revising a best guess, and there can be no guarantee about the accuracy of that guess.

The solution is to treat download-time estimates with some skepticism, and just be patient.

于 2012-04-10T20:59:01.673 回答
-2

以下是获取实际带宽的方法:

https://superuser.com/questions/356907/how-to-get-real-time-network-statistics-in-linux-with-kb-mb-bytes-format-and-for

使这个名为“netbps”的脚本可执行

#!/usr/bin/perl
use strict;
use warnings;
use Time::HiRes;

my $reporting_interval = 10.0; # seconds
my $bytes_this_interval = 0;
my $start_time = [Time::HiRes::gettimeofday()];

while (<>) {
  if (/ length (\d+):/) {
    $bytes_this_interval += $1;
    my $elapsed_seconds = Time::HiRes::tv_interval($start_time);
    if ($elapsed_seconds > $reporting_interval) {
       my $bps = $bytes_this_interval / $elapsed_seconds;
       printf "%02d:%02d:%02d %10.2f Bps\n", (localtime())[2,1,0],$bps;
       $start_time = [Time::HiRes::gettimeofday()];
       $bytes_this_interval = 0;
    }
  }
}

sudo tcpdump -i wlan0 -l -e -n | ./netbps

我只能说Firefox是错误的。该脚本为您提供了每秒字节数的良好估计。大约是firefox估计的1/4。所以新规则:如果感觉 Firefox 给出的时间太短,则乘以 4 以获得真实时间。

于 2013-01-11T03:58:21.003 回答