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. 机器学习-树模型理论(GDBT,xgboost,lightBoost,随机森林)

    tree based ensemble algorithms 主要介绍以下几种ensemble的分类器(tree based algorithms) xgboost lightGBM: 基于决策树算法 ...

  2. python3 小工具

    扫描IP的端口是否开放:Porttest.py # -*- coding: utf-8 -*- import sys import os import socket #扫描 def scanport( ...

  3. 松散的css

    <style> <p>hello world</p> {} p { color: red; } {} <em style="padding: 4px ...

  4. 【Swing程序设计/常用面板】

    面板也是一个Swing容器,可以作为容器容纳其他组件,但是它必须要被添加到其他容器中.Swing常见的面板是JPanel面板和JScrollPanel面板. JPanel面板可以聚集一些组件来布局. ...

  5. mui 轮播

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...

  6. 个人小爱好:Operating System: three easy pieces第6章第5节——总结

    总结 我们讨论了实现CPU虚拟化的部分底层机制,及我们统称为直接执行(direct execution)的一组技术.基本的思想十分简单明了:直接在CPU上运行你想运行的代码,但是你先得确保将硬件设置好 ...

  7. spfa最短路径

    C++代码 #include <iostream> #include <deque> #include <stack> #include <vector> ...

  8. linux 系统下apache 找不到apxs 文件

    yum install httpd-devel

  9. 20175303 2018-2019-2 《Java程序设计》第2周学习总结

    •总体的说,第2周主要学习了课本第二章第三章的内容,这周的学习简直比上一周的简单而且容易理解得多.上周的各种安装,注册,眼花缭乱,很早就开始弄,但各种出错,到最后都想放弃了,好在有同学的帮助,帮我正确 ...

  10. 可视化&地图__公司收集

    原文地址:https://github.com/zhongcaiwei/Data-visualization-technology-sharing 一.数据可视化企业(部分) 数字冰雹 光启元-腾讯 ...