Debian 使用 Speedtest CLI 进行测速
创作时间:
作者:
@小白创作中心
Debian 使用 Speedtest CLI 进行测速
引用
CSDN
1.
https://blog.csdn.net/xiangmuxs/article/details/139125158
本文将指导如何在Debian 11和Ubuntu 22.04下安装并使用Speedtest CLI进行测速。Speedtest CLI是Ookla官方推出的Linux/ BSD下的CLI工具,方便我们在服务器里直接测试公网带宽速度。
安装Speedtest CLI
首先,导入GPG Key并添加源:
apt install -y lsb-release ca-certificates apt-transport-https curl gnupg dpkg
curl -sSL https://packagecloud.io/ookla/speedtest-cli/gpgkey | gpg --dearmor > /usr/share/keyrings/speedtest.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/speedtest.gpg] https://packagecloud.io/ookla/speedtest-cli/debian/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/speedtest.list
然后更新系统并安装speedtest:
apt update
apt install speedtest -y
使用Speedtest CLI
安装完毕后我们即可使用默认的speedtest命令选择最近的节点并使用默认的网络测速,提示"Do you accept the license? [type YES to accept]"时,输入YES并回车即可。
高级用法
输入speedtest -h即可查看speedtest的命令参数:
root@debian ~ # speedtest -h
Speedtest by Ookla is the official command line client for testing the speed and performance of your internet connection.
Version: speedtest 1.1.1.28
Usage: speedtest [<options>]
-h, --help Print usage information
-V, --version Print version number
-L, --servers List nearest servers
-s, --server-id=# Specify a server from the server list using its id
-I, --interface=ARG Attempt to bind to the specified interface when connecting to servers
-i, --ip=ARG Attempt to bind to the specified IP address when connecting to servers
-o, --host=ARG Specify a server, from the server list, using its host's fully qualified domain name
-p, --progress=yes|no Enable or disable progress bar (Note: only available for 'human-readable'
or 'json' and defaults to yes when interactive)
-P, --precision=# Number of decimals to use (0-8, default=2)
-f, --format=ARG Output format (see below for valid formats)
--progress-update-interval=# Progress update interval (100-1000 milliseconds)
-u, --unit[=ARG] Output unit for displaying speeds (Note: this is only applicable
for ‘human-readable’ output format and the default unit is Mbps)
-a Shortcut for [-u auto-decimal-bits]
-A Shortcut for [-u auto-decimal-bytes]
-b Shortcut for [-u auto-binary-bits]
-B Shortcut for [-u auto-binary-bytes]
--selection-details Show server selection details
--ca-certificate=ARG CA Certificate bundle path
-v Logging verbosity. Specify multiple times for higher verbosity
--output-header Show output header for CSV and TSV formats
Valid output formats: human-readable (default), csv, tsv, json, jsonl, json-pretty
Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision
Valid units for [-u] flag:
Decimal prefix, bits per second: bps, kbps, Mbps, Gbps
Decimal prefix, bytes per second: B/s, kB/s, MB/s, GB/s
Binary prefix, bits per second: kibps, Mibps, Gibps
Binary prefix, bytes per second: kiB/s, MiB/s, GiB/s
Auto-scaled prefix: auto-binary-bits, auto-binary-bytes, auto-decimal-bits, auto-decimal-bytes
比较实用的有:
- 指定出口网卡:
speedtest -I 指定网卡名称 - 指定出口IP:
注意指定网卡或IP后可能会出现"[error] Error: [0] Cannot open socket"的错误提示,忽略即可。speedtest -i IP 地址 - 查看附近的测速节点列表:
speedtest -L - 指定某个测速节点:
speedtest -s 测速节点ID
最后秀一下我们的40Gbps公网带宽服务器:
热门推荐
DDoS防护中的流量清洗与智能调度:原理、技术与实践
插一根16G的内存条,和插两根8G的到底有区别吗?
可喷涂多孔水凝胶涂层助力高效可持续蒸发冷却
如何提升PPT内容的视觉吸引力?五个维度进行拆解
汽车的常规保养周期是多久?
房价的趋势如何判断?这种判断有哪些依据?
如何评估各地的房产状况?这种评估对居住需求有何影响?
传销危害很严重!你一定要知道!
武汉艾格眼科刘保松:手术后注意事项?
艾滋病与血常规:解读隐藏的健康信号
如何在Windows上实施强密码策略
飲食健康|食用隔夜菜不再猶豫!食安專家揭密5大關鍵
反应最快的哺乳动物:这种动物大脑特殊,可以在5毫秒内做出反应
炎症的症状表现及改善方法
发物水果真相揭秘:芒果、榴莲、荔枝,谁是你的健康隐形杀手?
银屑病的治疗方法有哪些?日常护理注意什么?
倪海厦谈肝经太冲、行间穴性:从气血流注到临床应用
在澳大利亚庆祝圣诞节:独特的节日传统
圣诞节的真实来历与寓意
一家美国机构,在印度“闷声发大财”的策略被揭开了
WPS考勤自动生成公式与数据验证:企业HR实践指南
企业信息安全防护:桌面云解决方案详解
前端如何写开发日志
小时候经常喝牛奶,长大会引发痤疮吗
宝可梦大集结巨金怪怎么玩 宝可梦大集结巨金怪技能解析
打破传统思维!中科院研发二维金属氧化物宏量制备新方法
清朝宫廷生活一瞥:宫女的居所
为什么虎口肌肉酸痛?
SDK:什么是软件开发工具包及其工作原理
戈洛夫宁事件:沙俄和日本幕府互扣人质,反倒促成双方文化交流