易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 521|回复: 1
收起左侧

linux系统查看网卡速度方法

[复制链接]
发表于 2023-5-19 15:35:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
使用speedtest-cli命令查看下载和上传最大流量
, V# }# w9 _/ E& b5 Byum install -y python-pip  
% D/ U. i' X, k" b* l9 n0 S4 f" [1 H
或者python get-pip.py4 r; n& ^& A9 K+ m6 `) z

3 h6 D1 U# ^. t! r5 z python get-pip.py
3 D) p; ^2 P% u4 c1 a5 y0 P9 @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.2 }7 F9 \& o$ T+ W% c
Collecting pip<21.03 N0 p- U  m+ t$ Q8 [! \
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
' v2 v" v5 f# g; f9 k     |????????????????????????????????| 1.5 MB 29 kB/s ) N, e6 z0 {; K% e# P0 N
Collecting wheel
# F9 W8 G7 M. Q  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)! U2 A& ]& B2 `# A1 |  h! {
Installing collected packages: pip, wheel
" V' P9 i3 n5 VSuccessfully installed pip-20.3.4 wheel-0.37.1
4 ^& c+ `( B+ V
' s, Y/ T, X3 p  p: c6 _( d5 `9 N! M$ z6 |2 A' B0 t4 `

1 u( i: k. g7 _) _安装speedtes-cli  
% J: b4 I5 h+ A' K9 spip install speedtest-cli ( s$ o: ^/ U+ x; m7 y+ {; B# |- V  q: O
pip install speedtest-cli
! M  P: d$ n6 z0 p; e' F) ]9 D$ [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.
" |: [# ?) n( `! OCollecting speedtest-cli: G' c; \: t+ {4 ]8 e5 i
  Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB)) o+ N+ A5 E; s! C8 I( s
Installing collected packages: speedtest-cli
. I* d: p! Z/ L* D0 gSuccessfully installed speedtest-cli-2.1.39 T. o  F7 e% |8 R$ w
# J' k/ \. ?) u- a+ \: v' l

4 n1 P  {1 b% Y3 d+ r  q, p3 j[root@test-vm ~]# speedtest
: m% @' }# j. G- |( N6 M  B$ Y: Lspeedtest      speedtest-cli  5 Q( Q: u) B& _1 }* L8 @- m6 D
[root@test-vm ~]# speedtest
: j' A* }( u6 }speedtest      speedtest-cli  
8 s! J+ o) G+ t+ X3 b3 _' W[root@test-vm ~]# speedtest-cli
. b+ I* u/ k/ E- O* F1 JRetrieving speedtest.net configuration..., m; q% t3 j# X6 a, x
Testing from Unknown (202.60.126.184)...
( I' H! N- F0 |9 NRetrieving speedtest.net server list...2 S- Z! J1 d, k! \; h/ R# I
Selecting best server based on ping...
3 r' X6 O# ?+ Q  G" k  THosted by 天津电信 (TianJin) [565.12 km]: 42.105 ms& f0 [; r8 K. r6 F
Testing download speed................................................................................2 v  q" ]  S. v  [
Download: 27.61 Mbit/s, a8 j6 H! w. _1 v
Testing upload speed................................................................................................* z) f- S& C$ l
Upload: 27.80 Mbit/s  @2 d# T, ^* S& T/ Y
[root@test-vm ~]# $ L8 e5 O6 G5 y  R7 m

+ t7 A& Z$ S" D7 k( `; L5 |* k. {0 n  p8 d$ b; g# G7 o4 T: v6 d; j

) y0 `3 G% `" n+ E# ]+ k使用nload命令查看:
  ?. l, L& G5 a/ v! W% S9 ^7 P! z4 n  [$ O1 R$ `( i
yum install -y nload
( Z- k# |3 v* j9 _+ n5 ]  m, {1 @5 L  [  ^1 S$ d

5 }2 C6 z3 C1 p$ ?或者dstat -n 命令:$ R3 F4 Y2 u. i- e
: B- p* @. C1 q
9 M5 F- q2 {! j+ ~% Y* t9 c, _

9 f* P; S3 a8 J* F再或者使用ethtool eth0
, b) a, l) h: u+ W+ E! S4 a. r查看网卡。
' ^! y* o6 U# Z
 楼主| 发表于 2023-5-19 15:48:15 | 显示全部楼层
[root@0002 ~]# cat /sys/class/net/eth0/speed
6 `, C5 l' r1 q[root@ ~]# cat /sys/class/net/enp2s0f0/speed
. J4 y' }% L/ m; ^" W1000
2 D# T1 f: w- w% }
* J+ o4 T  j4 L; F" @1 m' v[root@controller1 ~]# cat /sys/class/net/enp130s0f0/speed 4 |3 w0 \$ c& A0 M9 M1 T
10000
" a$ P! I- `& }* L# L0 h
' b6 P; K2 x" q" z2 P) j0 |+ |& V2 L
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-9 00:04 , Processed in 0.046336 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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