Linux系统下使用SpeedTest测速

2020-03-03T19:07:00

SpeedTest是用来测试网络上传/下载速率的一款工具,在Windows上能很方便的测试本地网络的上传/下载速率,而在>Linux上,也可以很方便的使用命令行来进行测试。

1.下载脚本

wget -N --no-check-certificate https://raw.github.com/sivel/speedtest-cli/master/speedtest.py

2.添加权限

chmod a+rx speedtest.py

3.开始测速

python speedtest.py

进阶版

1.如果你想生成一张图片,并分享给其他人,那么你应该这样:

python speedtest.py --share

在浏览器中打开生成的链接,如图所示

http://www.speedtest.net/result/9092753920.png

2.在默认情况下,SpeedTest是选择离测试机最近的一个节点进行测试的,如果你想要自定义测试到某个地区的上传/下载速率,那首先列出目前可用的SpeedTest服务器:

python speedtest.py --list

此时会列出所有的服务器(按照距离远近进行排列,不过我们不建议您使用此命令)

我们强烈推荐您一点一点的列出服务器

python speedtest.py --list|more

[scode type="share"]
[root@racknerd-44650e ~]# python speedtest.py --list|more
Retrieving speedtest.net configuration...
20794) IdeaTek Telcom (Hutchinson, KS, United States) [35.72 km]
16623) Cox - Wichita (Wichita, KS, United States) [43.14 km]
20531) Kansas Research and Education Network (Wichita, KS, United States) [43.14 km]
22144) H&B Communications (Holyrood, KS, United States) [106.27 km]
17295) Giant Communications, Inc. (Haviland, KS, United States) [113.97 km]
13965) Wilson Communications (Wilson, KS, United States) [132.34 km]
20949) Chisholm Broadband (Enid, OK, United States) [150.80 km]
21606) S&A Telephone (Allen, KS, United States) [175.61 km]
6889) Twin Valley Communications (Miltonvale, KS, United States) [180.51 km]
1345) Fort Hays State Univ (Hays, KS, United States) [181.31 km]
28219) Eagle Broadband Investments, LLC (Hays, KS, United States) [181.31 km]
[/scode]
如果我们想测试主机到Mimosa Networks这个节点的速率,那么是这样输入:

python speedtest.py --server 11599

如果您想要生成分享的图片,那就加上share

python speedtest.py --server 11599 --share
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »