温馨提示×

如何诊断centos dropped

小樊
37
2026-10-06 03:19:32
栏目: 智能运维

在 CentOS(及其他 Linux 系统)中,dropped 通常出现在网络、系统资源或日志相关场景中。下面按最常见场景说明如何“诊断 dropped 问题”。


一、网络丢包(最常见:RX/TX dropped)

1. 查看网卡丢包

ip -s link

或

ifconfig

重点看:

RX packets ... dropped: xxx
TX packets ... dropped: xxx

2. 查看具体网卡

ethtool -S eth0 | grep -i drop

常见原因:

  • 网卡缓冲区不足
  • 中断不均衡
  • 驱动问题
  • 网线 / 交换机问题

3. 查看网络队列

netstat -s | grep -i drop

或

ss -s

二、被防火墙丢弃(iptables / firewalld)

1. iptables 丢包统计

iptables -L -v -n

看 DROP 计数是否增长。

2. firewalld

firewall-cmd --list-all

可临时关闭测试:

systemctl stop firewalld

三、连接被内核丢弃(TCP / 半连接)

1. TCP 丢包

netstat -s | egrep 'dropped|overflow|listen'

常见指标:

  • TCPBacklogDrop
  • ListenOverflows
  • ListenDrops

原因:

  • backlog 太小
  • 并发过高
  • somaxconn 不足

2. 内核参数优化

sysctl -a | grep backlog

四、系统资源导致的 dropped

1. 内存不足

free -h
dmesg | grep -i oom

2. 文件描述符不足

ulimit -n
cat /proc/sys/fs/file-max

3. CPU 软中断过高

top
# 看 si 列
mpstat -P ALL 1

五、日志中的 “dropped”

1. 系统日志

journalctl -p err -xb
dmesg | grep -i drop

2. 应用日志

如 Nginx / MySQL:

  • worker_connections
  • too many open files

六、快速定位思路(推荐)

  1. 先确认 dropped 在哪一层
    • 网卡?
    • 防火墙?
    • 内核?
    • 应用?
  2. 用 ip -s link + netstat -s 初步判断
  3. 结合 dmesg / journalctl
  4. 必要时抓包:
tcpdump -i eth0 -nn port 80

七、如果你能补充信息,我可以更精准

请告诉我:

  • dropped 出现在哪里(命令 / 日志)
  • CentOS 版本(cat /etc/redhat-release)
  • 是网络、服务还是系统层面
  • 是否有高并发或异常流量

我可以直接帮你定位根因并给优化方案。

0 踩