zoukankan      html  css  js  c++  java
  • Linux测试上行和下载速率

    下载安装speedtest-cli测试工具

    方法一:
    pip3 install speedtest-cli
    方法二:
    wget https://github.com/sivel/speedtest-cli/archive/master.zip
    unzip master.zip
    cd speedtest-cli-master/
    chmod +x speedtest_cli.py

    执行speedtest.py进行网速测试

      首先我们采用pip的方式进行安装,我们需要进入python安装文件包的路径。
    pip3 install speedtest-cli --upgrade

    Requirement already up-to-date: speedtest-cli in /usr/local/python3/lib/python3.6/site-packages (2.0.2)
    

      从上面我们可以找到python软件包的安装路径,然后进入此路径。
    cd /usr/local/python3/lib/python3.6/site-packages/
    chmod +x speedtest.py
    ./speedtest.py --bytes

    Retrieving speedtest.net configuration...
    Testing from International Pioneering Park (114.114.114.114)...
    Retrieving speedtest.net server list...
    Selecting best server based on ping...
    Hosted by Beijing Telecom (Beijing) [1.69 km]: 3.782 ms
    Testing download speed................................................................................
    Download: 1.09 Mbyte/s
    Testing upload speed................................................................................................
    Upload: 1.08 Mbyte/s
    

    命令参数

    • speedtest.py --bytes以字节计算的方式来测试上下行速度
    • speedtest.py --share将速度测试的结果生成一张图片的连接,便于你分享
    • speedtest.py --simple只显示ping和上下行速度
    • speedtest.py --list 列出speedtest.net所有的服务器距离你的物理距离,单位是千米(km)
        由此我们可以测试出上传和下载的速率。
  • 相关阅读:
    linux内存-swap
    linux内存-buffer和cache
    Linux内存-内存管理机制oom_killer
    HTTPS(二)证书合法性校验
    HTTPS(一)基础及连接建立
    docker镜像(一)overlayfs
    DNS(三)全局流量调度
    建造者模式(Builder Pattern)
    抽象工厂模式(Abstract Factory)
    工厂方法模式(Factory Method Pattern)
  • 原文地址:https://www.cnblogs.com/Cherry-Linux/p/9121826.html
Copyright © 2011-2022 走看看