网速测试方法

网速测试方法

  • 方法一(官网下载):
    • 1、安装方法
    • 2、使用
  • 方法二(wget下载):
    • 1、安装方法
    • 2、使用

这两天项目上需要对上云业务网速进行测试,这里推荐推荐一个工具 speedtest,这里是官网链接。下面对两种方法进行记录。

方法一(官网下载):

1、安装方法

访问官网:https://www.speedtest.net/zh-Hans/apps/cli
网页拉到下面
网速测试方法_第1张图片
选择对应的系统版本,下载后上传到所在机器(这里我用的是linux的x86_64)包名:ookla-speedtest-1.1.1-linux-x86_64.tgz

[root@ecs-3a7c ~]# ls
anaconda-ks.cfg  ookla-speedtest-1.1.1-linux-x86_64.tgz  vmtools  vmtools-3.0.0.019.tar.bz2

2、使用

解压后就可以使用,执行

[root@ecs-3a7c ~]# tar -zxvf ookla-speedtest-1.1.1-linux-x86_64.tgz 
speedtest
speedtest.md
speedtest.5
[root@ecs-3a7c ~]# ./speedtest
==============================================================================

You may only use this Speedtest software and information generated
from it for personal, non-commercial use, through a command line
interface on a personal computer. Your use of this software is subject
to the End User License Agreement, Terms of Use and Privacy Policy at
these URLs:

	https://www.speedtest.net/about/eula
	https://www.speedtest.net/about/terms
	https://www.speedtest.net/about/privacy

==============================================================================

Do you accept the license? [type YES to accept]: yes
License acceptance recorded. Continuing.


   Speedtest by Ookla

     Server: China Telecom TianJin - TianJin (id = 35722)
        ISP: China Telecom
    Latency:     7.64 ms   (0.35 ms jitter)
   Download:   945.25 Mbps (data used: 1.1 GB )                               
     Upload:   596.02 Mbps (data used: 808.0 MB )                               
Packet Loss:     0.0%
[root@ecs-3a7c ~]# ./speedtest

   Speedtest by Ookla

     Server: China Telecom TianJin-5G - TianJin (id = 34115)
        ISP: China Telecom
    Latency:     7.50 ms   (0.36 ms jitter)
   Download:   949.05 Mbps (data used: 1.0 GB )                               
     Upload:   591.28 Mbps (data used: 693.4 MB )                               
Packet Loss:     0.0%

命令参数获取如下:

[root@ecs-3a7c ~]# ./speedtest --help

方法二(wget下载):

1、安装方法

这里使用wget进行下载,没有这个命令的同学,先进行yum安装wget。

yum install -y wget

我这里执行时yum报错,找不到镜像,原因是/etc/resolv.conf里面没有配置,增加配置如下:

[root@ecs-3a7c ~]# vi /etc/resolv.conf

nameserver 114.114.114.114

安装好wget后,安装speedtest

[root@ecs-3a7c ~]# wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
[root@ecs-3a7c ~]# chmod +x speedtest-cli

2、使用

直接执行以下命令

[root@ecs-3a7c ~]# ./speedtest-cli 
Retrieving speedtest.net configuration...
Testing from China Telecom (123.58.253.164)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by China Mobile Hebei Co., Ltd (石家庄) [370.42 km]: 3518.824 ms
Testing download speed................................................................................
Download: 1.48 Mbit/s
Testing upload speed................................................................................................
Upload: 2.07 Mbit/s

获取速度测试列表

[root@ecs-3a7c ~]# ./speedtest-cli --list
Retrieving speedtest.net configuration...
41852) 河南电信5G (Zhengzhou, China) [9.32 km]
41912) China Mobile Hebei Co., Ltd (石家庄, China) [370.42 km]
29105) 陕西移动5G (Xi'an, China) [445.31 km]
17145) China Telecom AnHui 5G (Hefei, China) [462.47 km]
27249) China Mobile jiangsu 5G (Nanjing, China) [559.21 km]
17320) China Mobile JiangSu 5G (ZhenJiang, China) [602.75 km]
26850) China Mobile 5G (Wuxi, China) [708.26 km]
 3973) China Telecom (Lanzhou, China) [909.71 km]
37235) Unicom (Shenyang, China) [1175.86 km]
48292) Cloudflare (Seoul, South Korea) [1230.84 km]

如果需要选择第4行中国合肥的服务器进行测试,命令如下:

[root@ecs-3a7c ~]# ./speedtest-cli --server 17145

获取帮助如下

[root@ecs-3a7c ~]# ./speedtest-cli -h

你可能感兴趣的:(Linux,linux,centos,运维)