1.安装speedtest-cli

speedtest-cli是一个用Python编写的轻量级Linux命令行工具,在Python2.4至3.4版本下均可运行。它基于Speedtest.net的基础架构来测量网络的上/下行速率。安装speedtest-cli很简单——只需要下载其Python脚本文件。

 2.下载并授权

# wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

# chmod +rx speedtest.py

# sudo mv speedtest.py /usr/local/bin/speedtest-cli

# sudo chown root:root /usr/local/bin/speedtest-cli

使用speedtest-cli测试网速

使用speedtest-cli命令也很简单,它不需要任何参数即可工作。

# speedtest-cli

输入这个命令后,它会自动发现离你最近的Speedtest.net服务器(地理距离),然后打印出测试的网络上/下行速率。

speedtest-cli --bytes以字节计算的方式来测试上下行速度
speedtest-cli --share将速度测试的结果生成一张图片的连接,便于你分享
speedtest-cli --simple只显示ping和上下行速度
speedtest-cli --list 列出speedtest.net所有的服务器距离你的物理距离,单位是千米(km)

3.执行

4.在浏览器请求http连接,如下所示

查看帮助信息:

speedtest-cli -h

usage: speedtest-cli [-h] [--no-download] [--no-upload] [--bytes] [--share]
[--simple] [--csv] [--csv-delimiter CSV_DELIMITER]
[--csv-header] [--json] [--list] [--server SERVER]
[--exclude EXCLUDE] [--mini MINI] [--source SOURCE]
[--timeout TIMEOUT] [--secure] [--no-pre-allocate]
[--version] Command line interface for testing internet bandwidth using speedtest.net.
--------------------------------------------------------------------------
https://github.com/sivel/speedtest-cli optional arguments:
-h, --help show this help message and exit
--no-download Do not perform download test
--no-upload Do not perform upload test
--bytes Display values in bytes instead of bits. Does not
affect the image generated by --share, nor output from
--json or --csv
--share Generate and provide a URL to the speedtest.net share
results image, not displayed with --csv
--simple Suppress verbose output, only show basic information
--csv Suppress verbose output, only show basic information
in CSV format. Speeds listed in bit/s and not affected
by --bytes
--csv-delimiter CSV_DELIMITER
Single character delimiter to use in CSV output.
Default ","
--csv-header Print CSV headers
--json Suppress verbose output, only show basic information
in JSON format. Speeds listed in bit/s and not
affected by --bytes
--list Display a list of speedtest.net servers sorted by
distance
--server SERVER Specify a server ID to test against. Can be supplied
multiple times
--exclude EXCLUDE Exclude a server from selection. Can be supplied
multiple times
--mini MINI URL of the Speedtest Mini server
--source SOURCE Source IP address to bind to
--timeout TIMEOUT HTTP timeout in seconds. Default
--secure Use HTTPS instead of HTTP when communicating with
speedtest.net operated servers
--no-pre-allocate Do not pre allocate upload data. Pre allocation is
enabled by default to improve upload performance. To
support systems with insufficient memory, use this
option to avoid a MemoryError
--version Show the version number and exit
 

linux(centos)测试带宽的更多相关文章

  1. linux测试带宽命令,Linux服务器网络带宽测试iperf

    linux测试带宽命令,Linux服务器网络带宽测试iperf必须先运行iperf serveriperf -s -i 2客户端iperf -c 服务端IP地址 iperf原理解析 iperf工具可以 ...

  2. 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器

    阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 我在阿里云购买的服务器配置 CPU:1核 内存:2G 系统盘:40G 公共镜像:CentOS 6.5 64位 公网带宽:1Mbps ...

  3. [工具]iperf测试带宽

    之前被要求测试网卡带宽能力,发现了iperf这个工具,记录下来防止遗忘. iperf是个开源跨平台测试带宽工具,windows.linux.macOS--都支持,安装也挺方便. 1.安装 地址:htt ...

  4. Linux Centos 通过虚拟用户访问FTP的配置

    Linux Centos 通过虚拟用户访问FTP的配置 实验需求: 让下面4个虚拟用户使用系统用户ftpvu的权限来连接到Linux FTP服务器,并确保都锁定在 自己的虚拟用户目录,不能切换到其他目 ...

  5. NoSql1 在Linux(CentOS)上安装memcached及使用

    前言:       今天是初五,生活基本要从过年的节奏中回归到正常的生活了,所以想想也该想想与工作有关的事情了.我之前在工作中会经常使用memcached和redis,但是自己一直没有时间系统的好好看 ...

  6. 阿里云服务器Linux CentOS安装配置(八)nginx安装、配置、域名绑定

    阿里云服务器Linux CentOS安装配置(八)nginx安装.配置.域名绑定 1.安装nginx yum -y install nginx 2.启动nginx service nginx star ...

  7. 阿里云服务器Linux CentOS安装配置(七)域名解析

    阿里云服务器Linux CentOS安装配置(七)域名解析 1.购买域名 登录阿里云,左侧菜单点击[域名],然后[域名注册],完成域名购买.(一般首年45元) 2.添加域名解析 在域名列表里点击你的域 ...

  8. 阿里云服务器Linux CentOS安装配置(六)resin多端口配置、安装、部署

    阿里云服务器Linux CentOS安装配置(六)resin多端口配置.安装.部署 1.下载resin包 http://125.39.66.162/files/2183000003E08525/cau ...

  9. 阿里云服务器Linux CentOS安装配置(五)jetty配置、部署

    阿里云服务器Linux CentOS安装配置(五)jetty配置.部署 1.官网下载jetty:wget http://repo1.maven.org/maven2/org/eclipse/jetty ...

  10. 阿里云服务器Linux CentOS安装配置(三)yum安装mysql

    阿里云服务器Linux CentOS安装配置(三)yum安装mysql 1.执行yum安装mysql命令:yum -y install mysql-server mysql-devel 2.启动mys ...

随机推荐

  1. windows系统关闭某个端口的服务(以443端口为例子)

    1.查看443被什么服务占用 netstat -ano | findstr 443 查看到443端口被pid为5140的服务占用了 2.去到任务管理器->任务 找到PID为5140的服务,然后停 ...

  2. vue2中使用 better-scroll

    使用时有三个要点: 一:html部分 <div class="example" ref="divScroll"> <div> <p ...

  3. HTML中的清除浮动的常用方法(转载)

    以下面的div为例: HTML: <div class="test"> <div class="test1"></div> ...

  4. mysql拿webshell总结

    1.select '<?php eval($_POST[jumbo]) ?>' into outfile '/var/www/jumbo.php'; 2.select '<?php ...

  5. vue 里filter的基本用法

    filter是和data  computed   methods watch一样,都是new Vue()的参数. 用于对简单数据的处理,和computed有冲突,所以从vue2.0后就对filter做 ...

  6. requirejs配置问题

    <script src="lib/requirejs/require.js " data-main="js/main.js"> </scrip ...

  7. ubantu中怎样安装VMware Tools

    点击虚拟机选择安装VMware tools tar zxvf VMwareTools-9.6.0-1294478.tar.gz -C /root/(安装到的目录)cd /root/cd vmware- ...

  8. vue2.0 vs vue

    vue2.0相比vue1.0 有哪些改变,今天总结了一下 vue2.0组件中 template 不在支持代码片段 //vue1.0组件中template写法 <template> < ...

  9. 构建一个可以统计 qps 的nginx服务的Dockerfile

    github 项目地址: https://github.com/SilentCC/nginx_lua_qps_count nginx 是经常会用到的web 服务器,它有出色的并发性能,因此尝尝被用来当 ...

  10. C#类型转换、进制转换

    string转byte[]: byte[] byteArray = System.Text.Encoding.Default.GetBytes ( str ); byte[]转string: stri ...