这篇文章上次修改于 1084 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

安装

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

# 安装pip
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# python get-pip.py

# 安装speedtest-cli
# pip install speedtest-cli

使用 

root@ubuntu:~# speedtest-cli 

购买的vps在国外,因此需要国内测速: 

# 搜索可以用来测速的服务器
root@ubuntu:~# speedtest-cli --list | grep China    
root@ubuntu:~# speedtest-cli --list | grep Shanghai   # 具体位置根据实际情况
13697) Shanghai Huajuan Information Technology Co., Ltd. (Khabarovsk, Russian Federation)
3633) China Telecom (Shanghai, China)
# 通过指定服务器编号来测速
root@ubuntu:~# speedtest-cli --server=3633  # 测试中国电信

图片显示测速结果: 

root@ubuntu:~# speedtest-cli --share

测速结束 会提示: 

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

 通过浏览器访问即可。