脚本 测试你到数据中心的速度
通过duang知道了这个有趣的项目,可以测试你到各个IDC之间的速度,节省时间
Github:DataCenterSpeedtest-cli
一般来说是在本机运行测速,当然 也可以在中转机上运行测速
先安装python3(请使用python 3.6或以下版本,3.7以上无法测试https节点的链接)和pip3
CentOS
yum -y install python3
yum -y install python3-pip
Debian/Ubuntu
sudo apt-get install python3
sudo apt-get install python3-pip
Windows请至python官网安装python3 (请使用python 3.6)
注意:Windows用户请将指令python3替换为python,pip3替换为pip。
安装python包
本项目依赖requests、prettytable、eventlet包,需输入:
pip3 install requests prettytable eventlet
来安装python包
MacOS用户如遇print错误,请在main.py开头添加如下代码:
import sys
import codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
下载项目文件
Windows用户可以直接下载本项目的压缩包并解压. 为了安装并使用此项目,您需要下载下载本项目的文件。您可使用git下载项目文件并进入项目文件夹:
git clone https://github.com/Spedoske/DataCenterSpeedtest-cli.git
cd DataCenterSpeedtest-cli
执行:
python3 main.py --list
如果出现类似于下图的表格,恭喜您安装成功.
| 服务商 | 节点位置 | 节点编号 |
|---|---|---|
| Amazon Web Services | 美国 弗吉尼亚州 阿什本 | 0 |
| Amazon Web Services | 美国 俄亥俄州 都柏林 | 1 |
| Amazon Web Services | 美国 俄亥俄州 都柏林 | 2 |
| Amazon Web Services | 美国 加利福尼亚州 旧金山 | 3 |
| Amazon Web Services | 美国 俄勒冈州 波特兰 | 4 |
| Amazon Web Services | 瑞典 斯德哥尔摩省 斯德哥尔摩 | 5 |
几个简单的命令
--search
允许筛选节点
--list
显示经过筛选后的节点
例如:
python3 main.py --search 日本 --list
| 服务商 | 节点位置 | 节点编号 |
|---|---|---|
| Amazon Web Services | 日本 东京都 东京 | 13 |
| Google Cloud Platform | 日本 东京都 东京 | 8 |
| Google Cloud Platform | 日本 大阪府 大阪 | 9 |
| Linode | 日本 东京都 品川区 | 7 |
| Vultr | 日本 东京都 东京 | 14 |
--speedtest
允许您对筛选后的节点进行测速
例如:
python3 main.py --search 日本 --speedtest --list
| 服务商 | 节点 | 速度 | 节点链接 |
|---|---|---|---|
| Amazon Web Services | 日本 东京都 东京 | 13.36 MB/s | ap-northeast-1-ec2.cloudharmony.net |
| Google Cloud Platform | 日本 东京都 东京 | 5.82 MB/s | asia-northeast1-gce.cloudharmony.net |
| Google Cloud Platform | 日本 大阪府 大阪 | 5.53 MB/s | asia-northeast2-gce.cloudharmony.net |
| Vultr | 日本 东京都 东京 | 226.19 KB/s | HND-JP-ping.vultr.com |
| Linode | 日本 东京都 品川区 | 21.28 KB/s | speedtest.tokyo2.linode.com |
更多详细命令请观看 DataCenterSpeedtest-cli WIKI