speetest-cli 是linux下一个上下行网速测试工具,是一个用python写的命令行脚本。python
须要python2.4-3.3支持。linux
github项目地址:https://github.com/sivel/speedtest-cligit
安装方法有不少种:github
一、pip / easy_install服务器
pip install speedtest-clicurl
oride
easy_install speedtest-cli工具
二、Github测试
pip install git+https://github.com/sivel/speedtest-cli.giturl
or
git clone https://github.com/sivel/speedtest-cli.git
python speedtest-cli/setup.py install
三、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服务器,并打印出你服务器当前的下行和上行带宽。
[root@localhost ~]# ./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 服务器并以图形方式展现。经过连接地址得到图形报告,以下图。
[root@localhost ~]# ./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 得到使用帮助