Linux中上下行网速测试工具 speedtest-cli

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux中上下行网速测试工具 speedtest-cli相关的知识,希望对你有一定的参考价值。

speetest-cli 是linux下一个上下行网速测试工具,是一个用python写的命令行脚本。

需要python2.4-3.3支持。

github项目地址:https://github.com/sivel/speedtest-cli


安装方法有很多种:


1、pip / easy_install

pip install speedtest-cli

or

easy_install speedtest-cli


2、Github

pip install git+https://github.com/sivel/speedtest-cli.git

or

git clone https://github.com/sivel/speedtest-cli.git

python speedtest-cli/setup.py install


3、Just download (Like the way it used to be)

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

chmod +x speedtest-cli

or

curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

chmod +x speedtest-cli


下载后添加可执行权限,直接执行命令

会查找距离最近的speedtest.net服务器,并打印出你服务器当前的下行和上行带宽。

[[email protected] ~]# ./speedtest-cli

Retrieving speedtest.net configuration...

Testing from China Telecom Guangdong (183.62.174.54)...

Retrieving speedtest.net server list...

Selecting best server based on ping...

Hosted by ShenZhen Telecom (Shenzhen) [0.00 km]: 1118.768 ms

Testing download speed................................................................................

Download: 4.65 Mbit/s

Testing upload speed................................................................................................

Upload: 9.15 Mbit/s


使用--share 参数,会将测试结果上传到speedtest.net 服务器并以图形方式展示。通过链接地址获得图形报告,如下图。

[[email protected] ~]# ./speedtest-cli --share

Retrieving speedtest.net configuration...

Testing from China Telecom Guangdong (183.62.174.54)...

Retrieving speedtest.net server list...

Selecting best server based on ping...

Hosted by 75510010 (ShenZhen) [0.00 km]: 2552.787 ms

Testing download speed................................................................................

Download: 2.43 Mbit/s

Testing upload speed................................................................................................

Upload: 2.31 Mbit/s

Share results: http://www.speedtest.net/result/7253182155.png

技术分享图片


使用./speedtest-cli -h 获得使用帮助


以上是关于Linux中上下行网速测试工具 speedtest-cli的主要内容,如果未能解决你的问题,请参考以下文章

linux通过speedtest-cli测试服务器网速

linux测网速

如何查看宽带上行,下行值?

linux网速测试

#yyds干货盘点#linux命令测网速

使用Linux命令行测试网速