安装speedtest
speedtest是一个用Python编写的轻量级Linux命令行工具,在Python2.4至3.4版本下均可运行。它基于Speedtest.net的基础架构来测量网络的上/下行速率。安装speedtest很简单——只需要下载其Python脚本文件。
$ wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
# chmod a+rx speedtest.py
# mv speedtest.py /usr/local/bin/speedtest
# chown root:root /usr/local/bin/speedtest
使用speedtest测试网速
使用speedtest命令也很简单,它不需要任何参数即可工作。
# speedtest
输入这个命令后,它会自动发现离你最近的Speedtest.net服务器(地理距离),然后打印出测试的网络上/下行速率,类似于这样的输出:
yangyan@VM-202-6-ubuntu:~/tmp$ ./speedtest.py
Retrieving speedtest.net configuration...
Testing from Tencent cloud computing (115.159.201.123)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by ChinaUnicom-5G (TianJin) [111.65 km]: 40.826 ms
Testing download speed................................................................................
Download: 86.39 Mbit/s
Testing upload speed................................................................................................
Upload: 1.17 Mbit/s
了解 工作生活心情记忆 的更多信息
Subscribe to get the latest posts sent to your email.