zoukankan      html  css  js  c++  java
  • linux网络命令

    网络测速

    speedtest-cli
    顾名思义,这个命令为网络测速命令,基于Python编写,测试系统网络的上传下载速度,GitHub托管的项目地址,以下列出常见的用法
    安装命令

    pip install speedtest-cli

    使用命令

    # 查看帮助,具体选项说明自行查看,这里列出几个常用的
    speedtest-cli -h
    参数说明原文
    -h, --help 显示帮助信息 show this help message and exit
    --share 测试的同时分享测试结果图片到speedtest官网 Generate and provide a URL to the speedtest.net share results image
    --simple 简化输出格式,只显示延迟,上传,下载 Suppress verbose output, only show basic information
    --list 列出系统附近的测速服务器 Display a list of speedtest.net servers sorted by distance
    --server SERVER 指定测速服务器的ID测速 Specify a server ID to test against. Can be supplied multiple times

    查看测速服务器

    # 打印全球的测速服务器,结果可能会非常多,可以重定向到文件保存,方便查看;或者只打印中国的测速服务器
    speedtest-cli --list | grep -i 'china' > servers.txt

    结果解释

    17251) ChinaTelecom-GZ (Guangzhou, CN) [2.51 km]
    # 拿以上第一条分析
    17251:测速服务器ID
    ChinaTelecom-GZ:中国广州电信,服务器运营商
    Guangzhou, CN:中国广州,服务器地址
    2.51 km:本机和测速服务器的距离,需要注意,list列出的服务器中,是按距离从小到大排序的

    测速

    # 指定某个测速服务器
    speedtest-cli --server 17251
    # 简化打印信息
    speedtest-cli --server 17251 --simple

    测速

    一条命令测速

    # 该命令默契情况下会选择最近距离的测速服务器作为测速
    curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -

    需要注意,执行过程可能会超时,那么就分两步执行,下载测速脚本,用Python执行,和命令行用法一样,也可以加执行参数
    一行式测速

    小结:上图中的几次测速,可以看到延迟、上传、下载的数据不一致,说明这个工具只是当做参考,不能做唯一指标

    [root@docker-03 ~]# curl ifconfig.me #查看公网IP地址
    120.208.125.117
  • 相关阅读:
    Centos7.6部署rsyslog+loganalyzer+mysql日志管理服务器
    linux编程基础
    天融信防火墙NGFW4000,无法进入web管理和community属性查看
    H3C_IRF_BFD配置
    H3C_IRF_LACP配置
    H3C_IRF
    h3c_7506e引擎主备镜像同步
    cisco4507引擎模式切换
    usg6000
    vpdn1
  • 原文地址:https://www.cnblogs.com/liujunjun/p/12456165.html
Copyright © 2011-2022 走看看