CentOS的下使用speedtest.net测速
in Linux服务器 with 0 comment

CentOS的下使用speedtest.net测速

in Linux服务器 with 0 comment

我们都知道windows下可以直接用浏览器访问www.speedtest.net来进行测速

If migrating from prior bintray install instructions please first...

sudo rm /etc/yum.repos.d/bintray-ookla-rhel.repo

sudo yum remove speedtest

Other non-official binaries will conflict with Speedtest CLI

Example how to remove using yum

rpm -qa | grep speedtest | xargs -I {} sudo yum -y remove {}

curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash
sudo yum install speedtest

更新:

#sudo yum install wget
#wget https://bintray.com/ookla/rhel/rpm -O bintray-ookla-rhel.repo
#sudo mv bintray-ookla-rhel.repo /etc/yum.repos.d/
#sudo yum install speedtest

但是我们从vps上怎么用呢 不要紧speedtest-cli来帮你忙

项目地址 https://github.com/sivel/speedtest-cli 有兴趣可以看一下

先来个一键脚本

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --no-check-certificate
chmod +x speedtest-cli
./speedtest-cli

安装

1、下载安装

wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --no-check-certificate
chmod +x speedtest-cli

or

curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --no-check-certificate
chmod +x speedtest-cli

pip / easy_install

pip install speedtest-cli

or

easy_install speedtest-cli

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

下面来说使用 使用就更简单了 直接

./speedtest.py

speedtest-cli 会搜索距离你最近的服务器进行测试(物理距离最近)

其实还有一些高级玩法

比如

speedtest-cli [-h] [--bytes] [--share] [--simple] [--list]
[--server SERVER] [--mini MINI] [--source SOURCE]
[--timeout TIMEOUT] [--secure] [--version]

-h, –help 显示帮助
–bytes 生成结果以字节显示(并不影响–share生成的图片)
–share 生成结果保存在speedtest服务器上并保存为图片链接
–simple 禁止详细输出,仅显示基本信息
–list 列出所有服务器ID
–server SERVER 指定一个服务器ID
–mini 指定你自己上传的speedtest mini客户端
–source SOURCE Source IP address to bind to
–timeout TIMEOUT HTTP timeout in seconds. Default 10
–secure Use HTTPS instead of HTTP when communicating with speedtest.net operated servers
–version Show the version number and exit

大多用到的功能就是 –server ** 和–share 了

服务器列表可以访问 https://www.speedtest.net/speedtest-servers-static.php

Responses