I'm not aware of a way to do this without a cooperating remote server. If you upload data, it has to go somewhere... Sites like speedtest.net do exactly that (they have a data sink somewhere).
Provided you do have ssh access to a remote server with a download link somewhat faster than the upload link you want to test, you may achieve this rather simply with netcat :
On your remote server (let's assume IP 1.2.3.4) :
$ nc -kl 12345 > /dev/null
On the machine you want to test :
$ time nc 1.2.3.4 12345 < large-file
$ stat -c'%s' large-file
Divide the file size by the "real" time and you have an estimation of your speed.
Note that you only need to run nc once on the server, and it will accept any number of sequential tests. If you only want it to work once (for security reasons or whatever), omit the -k flag.
I don't think that exists some command-line tool for this kind of test, but someone seems to have your same question, take a look at the solutions suggested there..
发布评论
评论(6)
我不知道在没有合作的远程服务器的情况下如何做到这一点。如果您上传数据,它必须发送到某个地方...像speedtest.net这样的网站正是这样做的(它们在某处有一个数据接收器)。
如果您确实可以通过 ssh 访问远程服务器,并且下载链接比您要测试的上传链接更快,您可以使用 netcat 来实现这一点:
在您的远程服务器上(假设 IP 1.2.3.4):
在计算机上您想要测试:
将文件大小除以“实际”时间,您就可以估计速度。
请注意,您只需在服务器上运行 nc 一次,它将接受任意数量的顺序测试。如果您只想让它工作一次(出于安全原因或其他原因),请省略 -k 标志。
I'm not aware of a way to do this without a cooperating remote server. If you upload data, it has to go somewhere... Sites like speedtest.net do exactly that (they have a data sink somewhere).
Provided you do have ssh access to a remote server with a download link somewhat faster than the upload link you want to test, you may achieve this rather simply with netcat :
On your remote server (let's assume IP 1.2.3.4) :
On the machine you want to test :
Divide the file size by the "real" time and you have an estimation of your speed.
Note that you only need to run nc once on the server, and it will accept any number of sequential tests. If you only want it to work once (for security reasons or whatever), omit the -k flag.
我从我在这里找到的另一篇文章中摘取了这一点,并认为我会传递它:
看起来 sourceforge 上有一个可用的工具,它从终端使用 speedtest.net 。
终端速度测试:http://sourceforge.net/projects/tespeed/
I took this from another post I found here and thought I would pass it on:
It looks like there is a tool available on sourceforge that uses speedtest.net from the terminal.
Terminal speedtest: http://sourceforge.net/projects/tespeed/
iperf 是为此而设计的工具。
您可以在连接的两端运行它,它可以使用 TCP 或 UDP 两种方式测量带宽,并且具有许多可调整的参数。
iperf
is a tool designed for this.You run it on both sides of the connection and it can measure bandwidth either way, with TCP or UDP, and has many tweakable parameters.
这是一个很棒的工具 tespeed。它非常详细地测试您的上传和下载速度。
This is a great tool tespeed. It tests your upload and download speeds with great details.
我认为不存在用于此类测试的命令行工具,但有人似乎拥有您的 同样的问题,看看那里建议的解决方案..
I don't think that exists some command-line tool for this kind of test, but someone seems to have your same question, take a look at the solutions suggested there..
如果您需要命令行工具,建议使用 iperf 进行速度测试。
Iperf 是一个很棒的工具,原因如下:
使用 iperf 进行网络速度测试
speed testing using iperf is advisable if you want a command line tool for that.
Iperf is an awesome tool because of the following reasons:
Network speed test using iperf