在 CentOS(以及一般 Linux 系统) 中,dropped 包(丢包) 通常指 网络数据包在接收或发送过程中被系统丢弃,无法被上层应用正常处理。
下面从 含义、常见位置、原因、排查方法 几个方面说明。
在 CentOS 中,你常会看到类似:
ip -s link
或
ifconfig
输出中有:
RX packets 123456 bytes 98765432
RX errors 0 dropped 123 overruns 0 frame 0
这里的 dropped 表示:
网卡已经收到(或尝试发送)的数据包,但内核决定丢弃,没有交给应用程序。
⚠️ dropped ≠ 网络线路丢包
dropped 是 本机内核层丢包
最常见,表示:
较少见,表示:
高并发时:
查看:
ethtool -S eth0 | grep -i drop
例如:
查看:
iptables -nvL
例如:
net.core.rmem_max 太小net.ipv4.tcp_max_syn_backlog 不够Web 服务(Nginx / Tomcat)连接暴增时:
accept 队列满查看:
ss -lnt
常见于:
ip -s link
ethtool -S eth0
cat /proc/net/dev
dmesg | grep -i drop
journalctl -k | grep -i drop
ss -lnt
iptables -nvL
nft list ruleset
# 增大接收缓冲区
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_max=16777216
# 增大连接队列
sysctl -w net.core.somaxconn=1024
sysctl -w net.ipv4.tcp_max_syn_backlog=8192
CentOS 中的 dropped 包 = 本机内核主动丢弃的数据包,通常不是网线断了,而是 系统性能、配置或安全策略问题。
如果你愿意,可以告诉我:
我可以帮你 精准定位原因并给优化方案。