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

linux系统查看网卡速度方法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-5-19 15:35:44 | 显示全部楼层 |阅读模式
使用speedtest-cli命令查看下载和上传最大流量
' z3 h' R! e$ R! L5 J5 }( b7 Syum install -y python-pip  
2 \* Y; F5 `. |" L% s1 W" J3 y0 @' |: x. D; O" _! C; `* ~
或者python get-pip.py# b) p' Z3 J: p; A5 F

* c, ^: V0 O8 _ python get-pip.py $ K+ h& v/ x( L. V* ~9 `
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.
6 T& ?4 u( O9 t* O1 sCollecting pip<21.0/ q7 }/ F- J* ~1 @, {" W+ F' R
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
: ]! a/ G$ W3 `     |????????????????????????????????| 1.5 MB 29 kB/s
9 Z  C- R6 P. T4 @8 VCollecting wheel' h' D0 }* C" E; c! e/ x: u
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
( [' v- b5 B. C1 O" w# s( {4 [Installing collected packages: pip, wheel* `8 |3 a- F+ C$ Y
Successfully installed pip-20.3.4 wheel-0.37.1
4 o/ D* R( m* ~
2 P# r  A! y4 a# b
% F% S9 O8 [8 J/ ^; Y; x) S3 A& @8 }0 d2 ^  p) Y
安装speedtes-cli  0 y* X) N# A0 ], U
pip install speedtest-cli + ~2 H5 O, T0 @0 \' ^  {- N; b, t- J3 t
pip install speedtest-cli
6 x; u2 ^/ v8 |6 e6 a9 q" [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.
, b8 I% P) b/ @Collecting speedtest-cli
) }; N$ q+ x/ _* L7 e  Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB)
- |) F& Q3 I: L% O* N2 TInstalling collected packages: speedtest-cli
) e' k/ g7 M; j% G3 c# HSuccessfully installed speedtest-cli-2.1.3
: n" S- T: j$ X  F1 q/ r- c( ^+ f+ I% j+ d
1 W8 P% w6 |* P$ B& M: a' n( p4 |
[root@test-vm ~]# speedtest3 n+ A6 {" p; G; K- H- O2 E
speedtest      speedtest-cli  
2 L0 O8 Q2 c& t4 C7 |6 l$ L+ I" ][root@test-vm ~]# speedtest
" E! {) [4 H& {; k; d9 a6 D9 Gspeedtest      speedtest-cli  
  X- j' i+ a1 p' I9 z; v/ J) X[root@test-vm ~]# speedtest-cli * |8 h+ _3 x& A% C8 Z  X
Retrieving speedtest.net configuration...
4 O; W; A6 f, U% |Testing from Unknown (202.60.126.184)...
- H4 V+ B1 ^- ]& U% r* pRetrieving speedtest.net server list..." v( g7 L3 y, d
Selecting best server based on ping...! k6 ~/ W9 d2 p7 |, e
Hosted by 天津电信 (TianJin) [565.12 km]: 42.105 ms
/ W. Z1 T" G* L, P. i2 gTesting download speed................................................................................
% q" ?# w1 {/ {2 i4 v. dDownload: 27.61 Mbit/s# N) ~5 X4 C9 U* M0 C
Testing upload speed................................................................................................
6 b0 s0 @2 c  H: n; b. uUpload: 27.80 Mbit/s
: w( i' }0 q+ s/ x$ v3 N[root@test-vm ~]#
" W: ]! F+ L' Y; ^# t' `8 _0 i
! D. A+ m; ?6 `. ^
5 v3 X1 r/ c1 d- `- q4 b. `, w" i3 o
使用nload命令查看:
  m! Z9 ?7 O/ Z+ B# u0 O0 Z* C6 ~
7 P  q7 c: t% }9 p% z5 V3 m; m! }yum install -y nload
- G& q; {0 x6 {2 A1 \! P; {1 ~5 H7 j$ I; `

% H+ t% y" h. o# h6 @( x或者dstat -n 命令:; }" X: v  Y8 W& b$ B. V, o

  g9 n5 E: Z5 b9 S" Y, n# h3 e) r% _- |

3 p# p8 }0 h" I# ^2 S% F再或者使用ethtool eth0
5 D/ f) `$ Q7 I+ j; I/ y8 c查看网卡。0 E3 d+ {: X2 J! Q1 Y) e: z

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-5-19 15:48:15 | 显示全部楼层
[root@0002 ~]# cat /sys/class/net/eth0/speed
, C1 V: L9 c- B) O# X[root@ ~]# cat /sys/class/net/enp2s0f0/speed ' [+ {' o/ ]. ~0 f
1000
0 q' l# }/ U8 N" _
& Q% F1 u9 D+ f1 K1 O- L[root@controller1 ~]# cat /sys/class/net/enp130s0f0/speed - Z8 I; r9 x# C
10000/ K& }2 B' ^- r3 X1 i

! [$ m7 x9 T- ^, G% i2 M3 [6 [3 l, O6 d( g* P  h1 a) g: i
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:32 , Processed in 0.013219 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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