Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用sar监控主机网络性能 #14

Open
bobenut opened this issue Mar 9, 2021 · 0 comments
Open

使用sar监控主机网络性能 #14

bobenut opened this issue Mar 9, 2021 · 0 comments
Labels

Comments

@bobenut
Copy link
Owner

bobenut commented Mar 9, 2021

干什么

最近在做一件事儿的时候,需要分析服务器网卡的收发速率,收发帧率等网络性能数据,看看带宽占用多少,能不能上去,找了一些命令,发现sar比较实用,能看到各网卡上的收发数据。sar命令显示的性能不仅限于网络。

sar是sysstat工具包内的一种工具,
不是所有版本的系统都装了,我自己的centos 7.2最简版默认不带。
装一下:

yum install sysstat

使用

每隔3秒刷新显示网络性能:

sar -n DEV 3

-n: 表示显示网络性能,还支持io,磁盘,cpu,内存等等等。

DEV:表示看网卡上的网络性能,还支持IP,ICMP,UDP流性能等等等,可以把DEV换成EDEV就能显示网卡传送数据时错误的数据。

3: 表示每隔几秒刷新一次。

网络性能显示:

Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s
Average: lo 0.01 0.01 0.00 0.00 0.00 0.00 0.00
Average: ens33 4000.33 15023 1223.71 12900.1 0.00 0.00 0.00
Average: docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00

IFACE:网卡,当前我的主机上的网卡是ens33。

rxpck/s:每秒收到的数据包数量,也叫每秒接受帧率。

rxpck/s:每秒发送的数据包数量,也叫每秒发送帧率。

rxkB/s:每秒收到的数据量,也叫接收速率,注意这里是大B,算成小b,乘以8。

txkB/s: 每秒发送的数据量,也叫发送速率。

rxcmp/s:每秒钟接受的压缩数据包。

txcmp/s:每秒发送的压缩包。

rxmcst/s:每秒接收的多播数据包。

@bobenut bobenut added the Linux label Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant