在 CentOS(或其他 Linux 系统)上看到 “dropped” 丢包,通常来自 ifconfig、ip -s link、netstat -i、sar -n DEV 或 ethtool -S 等命令。
“dropped” 和 “errors” 不同:errors 是硬件/链路错误,dropped 一般是 内核收到包但决定丢弃。
下面按「最常见 → 较少见」说明原因。
高流量或瞬时突发时,网卡或内核缓冲来不及处理。
查看:
ethtool -S eth0 | grep -i drop
常见字段:
rx_droppedrx_missed_errorsrx_fifo_errors解决:
# 增大网卡 ring buffer
ethtool -G eth0 rx 4096
# 增大内核 backlog
sysctl -w net.core.netdev_max_backlog=2000
常见于:
查看:
cat /proc/net/sockstat
或
ss -lnt
解决:
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_max=16777216
sysctl -w net.ipv4.tcp_rmem="4096 87380 16777216"
sysctl -w net.ipv4.tcp_wmem="4096 65536 16777216"
被 DROP 的包会计入 dropped。
查看:
iptables -L -v -n
nft list ruleset
常见场景:
单核软中断打满,其他队列空闲。
查看:
cat /proc/interrupts | grep eth
mpstat -P ALL 1
解决:
# 开启 RPS / RFS
sysctl -w net.core.rps_sock_flow_entries=32768
ethtool -k eth0
可尝试关闭:
ethtool -K eth0 gro off
ethtool -K eth0 lro off
检查:
ip link show
ping -M do -s 1472 <ip>
# 1. 看哪一层丢
ip -s link
# 2. 看网卡硬件统计
ethtool -S eth0
# 3. 看系统 socket
cat /proc/net/sockstat
# 4. 看防火墙
iptables -L -v -n
# 5. 看中断
cat /proc/interrupts
我可以更精确判断:
我可以直接给你对应的参数和配置。