找回密码
 注册
查看: 533|回复: 1

linux系统查看网卡速度方法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-5-19 15:35:44 | 显示全部楼层 |阅读模式
使用speedtest-cli命令查看下载和上传最大流量# o3 x: k+ G$ F' q  H% ~( p) R
yum install -y python-pip  7 `3 D: Y; {. ?# |+ o
/ j! X) s5 `$ X9 s5 E6 k$ f
或者python get-pip.py/ M  Q: X5 s0 @& n; E$ D& ^8 v& `: C

0 Q. I$ k; {7 k' N9 r1 H& Q python get-pip.py 2 w* e3 P) M$ H
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/de ... s/#python-2-support pip 21.0 will remove support for this functionality.! M; ~1 E  [9 W% _& G% E' q. \3 `; R" ^2 ^
Collecting pip<21.0; `, F6 o  |2 g9 Y5 T8 Q. c
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
% E5 G" u8 m* B6 [, F  u% \     |????????????????????????????????| 1.5 MB 29 kB/s 5 E9 f$ W5 M! |4 O; ^: ?% @, p
Collecting wheel
: A, _2 r" v9 ~  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)8 h7 W' Q7 f4 J2 Q
Installing collected packages: pip, wheel# m% ?# w! t6 s0 V# A  H0 |
Successfully installed pip-20.3.4 wheel-0.37.1
9 U9 s+ L( K) S
* ?6 M9 \- B  A7 s" {+ s
3 R5 r0 \9 N: D9 {3 V
- S3 s5 ]2 X% `1 c2 n& l安装speedtes-cli  4 y6 ?) ~+ s, g  i1 R2 r1 X
pip install speedtest-cli ; K& ~- u' R& P5 T# V
pip install speedtest-cli ; w; F7 Z& B8 O1 \6 e
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/de ... s/#python-2-support pip 21.0 will remove support for this functionality.5 {3 K! f. L2 n- d5 A. [+ w
Collecting speedtest-cli
" \0 M+ I) r4 E# j  Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB)5 C2 a8 d$ t4 @: f
Installing collected packages: speedtest-cli  C4 K$ Q8 H2 f# C0 \5 }) i6 ^8 d
Successfully installed speedtest-cli-2.1.3
2 {$ m* _% i8 m; |: W
0 @- z) l( G( t; o$ Q5 ^; @/ @9 K! D
[root@test-vm ~]# speedtest! }4 ?. j0 h' h; _3 S' f
speedtest      speedtest-cli  
- X- a2 |% I8 b[root@test-vm ~]# speedtest
% e* A# m: i: e2 B! ospeedtest      speedtest-cli  ! ]6 l% O6 Y1 ~( A  {5 {+ ~
[root@test-vm ~]# speedtest-cli
' X8 U0 }* T$ W$ G; T2 e/ {Retrieving speedtest.net configuration...$ ^. L' ~8 P9 P0 e& g  ~
Testing from Unknown (202.60.126.184)...
* ^- b1 W+ A* a4 k' {- ERetrieving speedtest.net server list.../ s0 t7 ~/ k( l; E" o$ m4 }
Selecting best server based on ping...
5 U" Q: Z" j' t: ~, }) Y6 fHosted by 天津电信 (TianJin) [565.12 km]: 42.105 ms3 o& H. b1 X9 K- F$ @; D4 Q1 d
Testing download speed................................................................................
" d. ~1 }% F- V3 D7 DDownload: 27.61 Mbit/s
6 F# V4 _4 g" R# P( C# NTesting upload speed................................................................................................
' r( s3 z0 G' n0 K' C/ M2 c+ tUpload: 27.80 Mbit/s# |' Q: C7 U4 L2 C
[root@test-vm ~]#
6 M  `6 V/ {! R& s/ ^+ H/ l% V; ~
% i5 f! D) g" Z9 {  Z$ b4 r9 s  ?# g

8 p7 k+ a# @( [使用nload命令查看:
: ^% F, l! c3 _. a9 I+ O: ]: H- I$ q' }
yum install -y nload
% V% r0 `. g5 a! ~
5 F1 q- B2 u: b1 V6 s
/ t, V6 h9 G" t) A$ k1 y或者dstat -n 命令:
; C$ d" S) v& S: h, G7 Z# p( v) B. b; s0 Y' S( K* y6 V9 R1 o
' ^" A6 a6 y2 V$ K. L# ?! t' o
) W& v; k) k0 _; T! u# J5 b
再或者使用ethtool eth00 o; o7 H( v5 y& _
查看网卡。: p* `" h1 o8 o! B& k

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-5-19 15:48:15 | 显示全部楼层
[root@0002 ~]# cat /sys/class/net/eth0/speed , S! L" q9 L4 C& ^6 o
[root@ ~]# cat /sys/class/net/enp2s0f0/speed 5 V6 q( H& C; X7 ]
1000: Z! }0 V. G' F1 {

, H7 G- g5 h2 U[root@controller1 ~]# cat /sys/class/net/enp130s0f0/speed ' q$ S6 B2 E# n
10000
7 ~( q# g4 s* O, \2 g/ I3 v! `
: c8 x1 z* j; H% y0 |. `3 D( j- L' k& V# C2 }  F' t
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 01:29 , Processed in 0.015587 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表