ifconfig 下面的一些字段(errors, dropped, overruns)
一台机器经常收到丢包的报警,先看看最底层的有没有问题:
# ethtool em2 | egrep 'Speed|Duplex'
Speed: 1000Mb/s
Duplex: Full # ethtool -S em2 | grep crc
rx_crc_errors: Speed, Duplex, CRC 之类的都没问题,基本可以排除物理层面的干扰。
通过 ifconfig 可以看到 overruns 字段在不停的增大:
# for i in `seq `; do ifconfig em2 | grep RX | grep overruns; sleep ; done dropped 出现问题的倒是遇到过几次,overruns 的倒是第一次遇到,再看看下面这个:
# ethtool -S em2 | grep drop
dropped_smbus:
tx_dropped:
rx_queue_0_drops:
rx_queue_1_drops:
rx_queue_2_drops:
rx_queue_3_drops:
rx_queue_4_drops:
rx_queue_5_drops:
rx_queue_6_drops:
rx_queue_7_drops: 发现数值也在不停的增加。G 了一下,发现这些 errors, dropped, overruns 表示的含义还不大一样。根据这篇文档的解释:
# ifconfig em2
em2 Link encap:Ethernet HWaddr AC::3D:A9::0D
inet addr:211.211.211.211 Bcast:211.211.211.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU: Metric:
RX packets: errors: dropped: overruns: frame:
TX packets: errors: dropped: overruns: carrier:
collisions: txqueuelen:
RX bytes: (2.3 TiB) TX bytes: (1.3 TiB)
Memory:94b00000-94b20000 RX errors: 表示总的收包的错误数量,这包括 too-long-frames 错误,Ring Buffer 溢出错误,crc 校验错误,帧同步错误,fifo overruns 以及 missed pkg 等等。
RX dropped: 表示数据包已经进入了 Ring Buffer,但是由于内存不够等系统原因,导致在拷贝到内存的过程中被丢弃。
RX overruns: 表示了 fifo 的 overruns,这是由于 Ring Buffer(aka Driver Queue) 传输的 IO 大于 kernel 能够处理的 IO 导致的,而 Ring Buffer 则是指在发起 IRQ 请求之前的那块 buffer。很明显,overruns 的增大意味着数据包没到 Ring Buffer 就被网卡物理层给丢弃了,而 CPU 无法即使的处理中断是造成 Ring Buffer 满的原因之一,上面那台有问题的机器就是因为 interruprs 分布的不均匀(都压在 core0),没有做 affinity 而造成的丢包。
RX frame: 表示 misaligned 的 frames。 对于 TX 的来说,出现上述 counter 增大的原因主要包括 aborted transmission, errors due to carrirer, fifo error, heartbeat erros 以及 windown error,而 collisions 则表示由于 CSMA/CD 造成的传输中断。 在梳理这些 error/drop/discard 的时候,由于涉及到不同的 NIC 型号,ethtool/netstat 或者是直接从 proc 里面获取到的数据所代表的意思还不完全一样,比如上面通过 ethtool 得到的「丢包」是通过 rx_queue_NUM_drops 这个字段表示的,而通过 netstat 看到的却是 RX-OVR 表示的,一个是 overruns 一个是 dropped,字面意思完全不同:
# netstat -i | column -t
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
em2 BMRU 不管是使用何种工具,最终的数据无外乎是从下面这两个文件获取到的: /sys/class/net/em2/statistics/
/proc/net/dev
# cat /proc/net/dev | column -t
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
em2: 对于上面出现的若干种问题,一方面是做好监控,另外一方面是出现问题的时候及时的想到各种的可能,无外乎那么几种。Google 过程中发现了 stackexchange 上还没人回答的问题,结合上面的,我顺便回答了一下,基本,遵循里面的四点,% 以上的场景应该能轻松应对。
ifconfig 下面的一些字段(errors, dropped, overruns)的更多相关文章
- 【Linux命令】系统状态检测命令8个(ifconfig、uname、uptime、free、who、last、history、sosreport)
目录 ifconfig获取网卡配置信息 uname查看系统内核版本 uptime查看系统的负载信息 free查看内存信息 who查看当前主机用户的终端信息 last查看系统的登录记录 history查 ...
- Linux网络——配置网络之ifconfig家族命令
Linux网络——配置网络之ifconfig家族命令 摘要:本文主要学习了ifconfig家族用来配置网络的命令. ifconfig命令 ifconfig命令用来显示或设置网络接口信息,设置只是临时生 ...
- CentOS 7最小化安装后找不到‘ifconfig’命令——修复小提示
如果你不知道在哪里可以找到ifconfig命令,请按照以下简单的步骤来找到它.首先,让我们找出哪个包提供了ifconfig命令.要完成这项任务,输入以下命令: [root@jrserver app_f ...
- Linux命令之ifconfig
许多windows非常熟悉ipconfig命令行工具,它被用来获取网络接口配置信息并对此进行修改.Linux系统拥有一个类似的工具,也就是ifconfig(interfaces config).通常需 ...
- ifconfig 中的 eth0 eth0:1 eth0.1 与 lo
1. eth0 eth0:1 eth0.1 eth0 eth0:1 和eth0.1三者的关系对应于物理网卡.子网卡.虚拟VLAN网卡的关系:物理网卡:物理网卡这里指的是服务器上实际的网络接口设备,这里 ...
- Linux ifconfig 命令
在centos6 自带ifconfig 在centos7 默认不带ifconfig,需要自己安装 ifconfig命令用来配置或查看网卡接口,常见用法如下: 安装ifconfig命令 [root@my ...
- linux命令学习之:ifconfig
ifconfig命令被用于配置和显示Linux内核中网络接口的网络参数.用ifconfig命令配置的网卡信息,在网卡重启后机器重启后,配置就不存在.要想将上述的配置信息永远的存的电脑里,那就要修改网卡 ...
- Linux-(lsof,ifconfig,route)
lsof命令 1.命令格式: lsof [参数][文件] 2.命令功能: lsof(list open files)是一个列出当前系统打开文件的工具.在linux环境下,任何事物都以文件的形式存在,通 ...
- ifconfig 查看网卡信息
[root@linux-node- sss]# ifconfig eno16777736: flags=<UP,BROADCAST,RUNNING,MULTICAST> mtu inet ...
随机推荐
- node-webkit 桌面开发 初入1
node-webkit 是什么就不介绍了 注意官网的一句话 ”node-webkit is based on Chromium and node.js " 所以node-webkit 实际 ...
- Xcode使用HTTP配置
Xcode7 出现获取网络请求时出现如下异常: App Transport Security has blocked a cleartext HTTP (http://) resource load ...
- Java 多线程之单例设计模式
转载:https://segmentfault.com/a/1190000007504892 概念: Java中单例模式是一种常见的设计模式,单例模式的写法有好几种,这里主要介绍两种:懒汉式单例.饿汉 ...
- Python之路----------ConfigParser模块
Python的ConfigParser 废话不说,拿去用 #coding=utf-8 import configparser ''' 基於Python3.0版本寫的配置文件的創建.增加.刪除.修改等方 ...
- Leetcode: Range Addition
Assume you have an array of length n initialized with all 0's and are given k update operations. Eac ...
- PAT——乙级真题1003代码
#include<iostream> #include<string> using namespace std; int getLength(string str0); int ...
- @RequestMapping注解详解
@RequestMapping是一个用来处理请求地址映射的注解,可用于类或者方法上.用于类上,表示类中的所有响应请求的方法都是以该地址作为父路径.@RequestMapping注解有六个属性,下面进行 ...
- com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command ' finished with non-zero exit value 1
Error:Execution failed for task ':lenovoAlbum:processReleaseResources'. > com.android.ide.common. ...
- struts自定义拦截器配置
配置自己的拦截器可以先参照下系统的拦截器是怎么配置的,首先打开struts-default.xml搜索下interceptor:系统里的拦截器有很多,拦截器都是放在堆栈里的,系统引用的是默认堆栈, & ...
- oracle 11g 服务启动时提示1053错误,服务启动不了,重新配置监听解决问题
早上发现oracle服务启动不了了,找了很多资料,没找到有用的.通过重新配置监听解决问题.