良许Linux教程网 干货合集 Linux下通过speedtest-cli测试网速

Linux下通过speedtest-cli测试网速

speedtest-cli 是一个使用python编写的命令行脚本,通过调用speedtest.net测试上下行的接口来完成速度测试,最后我会测试运维生存时间所在服务器的外网速度。

环境

Centos7

安装speedtest-cli工具

在安装speedtest-cli之前,我们需要安装先安装python3-pip包管理器,然后通过pip安装speedtest-cli工具。

[root@localhost ~]# yum -y install python3-pip
使用Speedtest CLI测试你的网速使用Speedtest CLI测试你的网速

安装成功之后,我们可以用pip3命令安装speedtest-cli:

[root@localhost ~]# pip3 install speedtest-cli
使用Speedtest CLI测试你的网速使用Speedtest CLI测试你的网速

通过speedtest cli检测网络

[root@localhost ~]# speedtest-cli
Retrieving speedtest.net configuration...
Testing from China Telecom (*.*.*.*)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by China Telecom JiangSu 5G (Lianyungang) [196.15 km]: 31.424 ms
Testing download speed................................................................................
Download: 47.64 Mbit/s
Testing upload speed......................................................................................................
Upload: 94.56 Mbit/s
使用Speedtest CLI测试你的网速使用Speedtest CLI测试你的网速

总结

在本文中我们将使用一个名为speedtest-cli的命令行工具来测试网速。它是用Python语言编写的工具,系统通过向speedtest.net网站上传和下载数据来测试带宽。

以上就是良许教程网为各位朋友分享的Linu系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

img
本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部