我最好的理论是,某些内核限制被触及,阻止了出站连接。我们基本上尝试了所有方法,从 tcpdump 到配置一个全新的虚拟服务器(我们在任何其他虚拟服务器上都没有这个问题),然而问题不知何故仍然存在,即使使用新的 postfix 版本(工作正常)。
只要 postfix 没有太多事情要做,电子邮件和出站连接都可以正常工作。/proc/user_beancounters 显示没有达到限制(如下所示)。尽管如此,ping 甚至失败到 IP 地址。TCP 堆栈看起来健康。负载很低。没有 iowait。已经刷新了 iptables。有人遇到过这样的事情吗?
uid resource held maxheld barrier limit failcnt
3: kmemsize 166216365 170262528 9223372036854775807 9223372036854775807 0
lockedpages 0 0 9223372036854775807 9223372036854775807 0
privvmpages 285727 351885 9223372036854775807 9223372036854775807 0
shmpages 16933 17605 9223372036854775807 9223372036854775807 0
dummy 0 0 0 0 0
numproc 150 303 9223372036854775807 9223372036854775807 0
physpages 314156 326191 0 1280000 0
vmguarpages 0 0 9223372036854775807 9223372036854775807 0
oomguarpages 165355 165355 9223372036854775807 9223372036854775807 0
numtcpsock 89 172 9223372036854775807 9223372036854775807 0
numflock 22 76 9223372036854775807 9223372036854775807 0
numpty 1 2 9223372036854775807 9223372036854775807 0
numsiginfo 0 75 9223372036854775807 9223372036854775807 0
tcpsndbuf 2733472 4371752 9223372036854775807 9223372036854775807 0
tcprcvbuf 1798336 5427296 9223372036854775807 9223372036854775807 0
othersockbuf 491120 1000760 9223372036854775807 9223372036854775807 0
dgramrcvbuf 0 238728 9223372036854775807 9223372036854775807 0
numothersock 361 505 9223372036854775807 9223372036854775807 0
dcachesize 135941831 136114679 9223372036854775807 9223372036854775807 0
numfile 2905 4990 9223372036854775807 9223372036854775807 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 8 9 9223372036854775807 9223372036854775807 0
Ping 输出:
[root@xxx /]# ping 4.2.2.1
PING 4.2.2.1 (4.2.2.1) 56(84) bytes of data.
--- 4.2.2.1 ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 8493ms
[root@xxx /]# service postfix stop
[root@xxx /]# ping 4.2.2.1
PING 4.2.2.1 (4.2.2.1) 56(84) bytes of data.
64 bytes from 4.2.2.1: icmp_seq=1 ttl=53 time=8.63 ms
64 bytes from 4.2.2.1: icmp_seq=2 ttl=53 time=8.62 ms
64 bytes from 4.2.2.1: icmp_seq=3 ttl=53 time=8.63 ms
64 bytes from 4.2.2.1: icmp_seq=4 ttl=53 time=8.66 ms
当 postfix 运行时,所有类型的出站连接都会失败。
答案1
问题在于路由器(数据包过滤器)中的防火墙规则错误。