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

linux系统查看网卡速度方法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-5-19 15:35:44 | 显示全部楼层 |阅读模式
使用speedtest-cli命令查看下载和上传最大流量- W# Q) b: d) ]  l$ t# `
yum install -y python-pip  ! d, r6 Q* e& W+ T

7 ]5 K# i3 G( e+ q! h; |或者python get-pip.py
  S2 N' W: k% ~6 Q! d! u$ P# @5 e5 A9 j" u* O% d6 v2 V/ y. K* I# h
python get-pip.py , P% k9 k. c. k; J. P7 s1 C
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.
; \1 A8 E! Y6 _0 Y, R  H0 ?  k% r0 SCollecting pip<21.0; [( u, c: u+ S7 p) T
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)1 q1 P' X- {3 Q, s2 E
     |????????????????????????????????| 1.5 MB 29 kB/s + F' A2 j  B: _" I
Collecting wheel
" M: K' t( o& {5 ?+ ~6 S6 P  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)+ @8 L7 l' t, c* \+ W3 u5 I/ J
Installing collected packages: pip, wheel, B& C$ `' c; `; v
Successfully installed pip-20.3.4 wheel-0.37.1
8 f! v/ K2 M% s  ^. H- H0 D# {" p2 b' Y0 _; w
5 t# ~5 t. J3 Y; S. x

. K2 y- F$ @3 Q' @" d安装speedtes-cli  1 f+ B+ A% B" |$ C1 W* X2 Y3 C
pip install speedtest-cli
, _( _* S: Q, y4 ?1 dpip install speedtest-cli " d. E! N2 G& m
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.
; `( b( p  A7 Q; `/ d/ uCollecting speedtest-cli0 b3 R5 t3 M) U: f7 ^  p: B
  Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB)
  d8 q1 J  ?4 v" o" sInstalling collected packages: speedtest-cli
  d2 G+ }! w2 `7 U0 b& r) v$ v- wSuccessfully installed speedtest-cli-2.1.34 l: b* n8 N3 c2 l9 z5 |( m
) j) E0 k; _/ ?! ?
9 K9 G( l- R: {: V, k
[root@test-vm ~]# speedtest
0 t" N! I1 R" {" r5 a4 ispeedtest      speedtest-cli    m) r( _" ~! \0 t, r8 Q
[root@test-vm ~]# speedtest7 H1 w: b6 y: K: U* t
speedtest      speedtest-cli  1 s% Y' u: M, c2 q
[root@test-vm ~]# speedtest-cli 3 m+ \/ H2 t$ U7 }2 y! c
Retrieving speedtest.net configuration...
* E5 \' H/ [7 m6 `Testing from Unknown (202.60.126.184)..., @; i5 P& Z* F  O
Retrieving speedtest.net server list...# R0 y; ]6 X% p1 r8 i6 U6 r6 Z$ S
Selecting best server based on ping..." i% [* B1 E- S  k: j6 o
Hosted by 天津电信 (TianJin) [565.12 km]: 42.105 ms
" j' ]# @7 ^5 y5 ?# Y6 ^  U# Z7 }Testing download speed................................................................................3 q; C0 o& B7 z, W2 u, c
Download: 27.61 Mbit/s4 t' @9 R5 \. r- i, c* }
Testing upload speed................................................................................................+ m* ~. Q9 Y2 o. `6 Y( r8 |
Upload: 27.80 Mbit/s/ A0 ^& P. d5 }) a2 m5 P) w7 U6 j
[root@test-vm ~]#
+ P" t: }3 h, {8 i4 W& @. t
: W7 T# v( f, n. Y# n
9 d- Z9 H& k5 {( n3 c7 @& O
4 H+ O. Z& n& t0 L4 F1 J使用nload命令查看:8 R6 }/ j5 w/ }. }+ N# Y1 r/ g& {/ ^
( B9 x5 T  T" y8 q, x! N
yum install -y nload
0 z/ [6 B! T2 t5 Y0 z; a6 b9 s7 V4 \8 V- @

8 I, j2 G4 Y. Q或者dstat -n 命令:
1 X( r  o% M4 e- k& @, [
0 F1 w) P2 I: h( s0 L
. \, U9 R5 G, }: {  y& d. ~8 H. Q
再或者使用ethtool eth0( }+ \& m  i" {
查看网卡。
) ^8 U2 u4 @2 }( u" k& F' E- y4 Z

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-5-19 15:48:15 | 显示全部楼层
[root@0002 ~]# cat /sys/class/net/eth0/speed
2 ~+ K1 Z1 c+ [+ B[root@ ~]# cat /sys/class/net/enp2s0f0/speed
) X- a9 K; X% X; C( g5 C  Q1000
6 l' S& ?+ c3 @: P3 K9 v5 v+ Z5 u6 }" x+ T
[root@controller1 ~]# cat /sys/class/net/enp130s0f0/speed
- s* h( c0 B. C3 d10000( Z) k% m0 L: w7 k# v# P! |( @# P1 |; a
& y9 N/ ?- l" @% c
" G% V$ L. P$ A, W( Y5 _2 F, |
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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