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

linux系统查看网卡速度方法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-5-19 15:35:44 | 显示全部楼层 |阅读模式
使用speedtest-cli命令查看下载和上传最大流量
$ x" E/ H4 h* Z0 ]6 C* |1 R! cyum install -y python-pip  
1 x" y& `+ K% a% E
' c/ r7 h' S( x- i' h" Q或者python get-pip.py
; U: N* N0 j9 r8 [% O0 Z7 C9 r) S' n: l- E& W  u, o" I8 ?
python get-pip.py
, W  J% {- X; {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./ e7 U9 G+ w9 |, f+ D) V
Collecting pip<21.0
9 a5 X' {5 ~5 ~9 {  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
' Q) H. y& n& t$ O3 M  u     |????????????????????????????????| 1.5 MB 29 kB/s
7 D. q  U; @! Q/ W$ w, d+ f9 TCollecting wheel) [! E  o2 ]* j8 _1 R
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
' ?- E1 n9 C1 g0 D  IInstalling collected packages: pip, wheel
0 R7 b! l5 M. p7 VSuccessfully installed pip-20.3.4 wheel-0.37.1. {$ P# W5 Q4 _' j) O
: T" O3 F) I' y4 k* [$ \8 l

: X8 t# }% w! F/ j% ^4 `( ^5 E, I8 c+ Q3 N
安装speedtes-cli  
& }2 @8 ?0 m' _' A* a, Z9 ^. upip install speedtest-cli
* B3 T" }' |3 Jpip install speedtest-cli
( ^# K9 B# @) r: ]8 fDEPRECATION: 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.
# j/ }9 L* _7 o9 Z; d* I" SCollecting speedtest-cli
+ H8 e0 C. x0 y' p& L9 A4 x  Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB)/ j- U" ?+ c8 S
Installing collected packages: speedtest-cli
; |# n/ V' t$ s( U- w1 PSuccessfully installed speedtest-cli-2.1.3* B4 I2 b' _4 ~; p5 E7 J$ M
! U9 V8 {% V- e, \! ^
6 Q6 p. o2 }- `! k  Y5 K, C
[root@test-vm ~]# speedtest
+ L) E7 h5 o1 Ospeedtest      speedtest-cli  & |' H: D6 A: t1 T7 |/ [$ L
[root@test-vm ~]# speedtest
; C7 f8 R: R3 {" ]speedtest      speedtest-cli  
2 ?8 [3 i/ b& K3 X8 f* P5 I[root@test-vm ~]# speedtest-cli " B" s7 G$ T3 u7 }
Retrieving speedtest.net configuration...
& j; A& C$ S. ~. {! N$ X2 UTesting from Unknown (202.60.126.184)...- z% e1 q4 ~, R' F
Retrieving speedtest.net server list...
# y& i% P- d5 [  N- _# X( R! A" dSelecting best server based on ping...
+ ^  t1 d7 c6 D( y: x4 h% aHosted by 天津电信 (TianJin) [565.12 km]: 42.105 ms' C* E/ A8 `  Z2 C1 H1 o. A
Testing download speed................................................................................5 Y4 j: p2 p& G; Q+ k
Download: 27.61 Mbit/s1 r8 ?8 L: `- W5 y
Testing upload speed................................................................................................
4 l' n$ j3 b- ^0 W6 k% l/ y+ [( v1 bUpload: 27.80 Mbit/s% N( ~6 K, a5 N; @$ q4 I6 b9 H1 z2 R2 C  y
[root@test-vm ~]#
2 W' Y7 n/ D, _+ [, w) n. S$ A% w: X; o) M$ E5 y

( r  c4 b, f& X4 F3 T; {" l# I7 a5 L4 h3 L1 i
使用nload命令查看:6 w& ]. J# I$ q. \/ F1 R
/ @& [% b* K9 m5 m% V4 L" s9 R
yum install -y nload3 c$ V3 f6 S* x" G% I
9 ^" L( `7 n8 l7 U3 [& r5 i  K# p5 H
' Q4 T! Q/ {7 I: l0 F/ t
或者dstat -n 命令:  v$ o* o) _" u- Z1 C

# }; h6 b" t; T2 f8 K
; J9 x8 b6 ^- |: Z1 j
/ i: x& _( Q) T1 r6 b( `+ q再或者使用ethtool eth05 R5 W5 n/ o  W+ m' ^3 f, r# c, X
查看网卡。
- [+ o  f  E% o$ q  J4 J

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-5-19 15:48:15 | 显示全部楼层
[root@0002 ~]# cat /sys/class/net/eth0/speed
) q, G& f6 y/ l* y[root@ ~]# cat /sys/class/net/enp2s0f0/speed 7 q9 B) D$ r3 e
1000
) u$ Z8 \/ r5 C# @
( ]8 p9 h" U* _- K6 c[root@controller1 ~]# cat /sys/class/net/enp130s0f0/speed
# T6 v/ l: ~1 w9 }" }4 z, t# P10000  g6 V4 D, Z8 g* f' f. M$ y% g

: B! A% H5 _; V) o! E6 x0 f  j+ B3 b! A, ~* E3 z2 K, q& @
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:34 , Processed in 0.024305 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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