我们在CentOS上运行Redis服务器并从CentOS客户端连接到它。 大多数请求都已成功完成,但服务器有时无法响应来自客户端的SYN数据包。
那时,客户端TCP套接字状态为SYN_SENT,重试后客户端放弃了连接。
tcpdump结果:
18:11:05.031716 IP 192.168.1.110.56287 > 192.168.1.100.6379: Flags [S], seq 1819611675, win 14600, options [mss 1460,sackOK,TS val 774050308 ecr 0,nop,wscale 7], length 0
18:11:05.892703 IP 192.168.1.110.42376 > 192.168.1.100.6379: Flags [S], seq 1513100388, win 14600, options [mss 1460,sackOK,TS val 773648381 ecr 0,nop,wscale 7], length 0
18:11:05.892723 IP 192.168.1.100.6379 > 192.168.1.110.42376: Flags [S.], seq 174277326, ack 1513100389, win 14480, options [mss 1460,sackOK,TS val 773688703 ecr 773648381,nop,wscale 7], length 0
18:11:05.894383 IP 192.168.1.110.42376 > 192.168.1.100.6379: Flags [F.], seq 15, ack 2413, win 160, options [nop,nop,TS val 773648383 ecr 773688704], length 0
18:11:05.894533 IP 192.168.1.100.6379 > 192.168.1.110.42376: Flags [F.], seq 2413, ack 16, win 114, options [nop,nop,TS val 773688704 ecr 773648383], length 0
18:11:06.031146 IP 192.168.1.110.56287 > 192.168.1.100.6379: Flags [S], seq 1819611675, win 14600, options [mss 1460,sackOK,TS val 774051308 ecr 0,nop,wscale 7], length 0
18:11:07.886769 IP 192.168.1.110.56288 > 192.168.1.100.6379: Flags [S], seq 686592816, win 14600, options [mss 1460,sackOK,TS val 774053163 ecr 0,nop,wscale 7], length 0
18:11:07.886788 IP 192.168.1.100.6379 > 192.168.1.110.56288: Flags [S.], seq 1370830450, ack 686592817, win 14480, options [mss 1460,sackOK,TS val 773690697 ecr 774053163,nop,wscale 7], length 0
18:11:07.887957 IP 192.168.1.110.56289 > 192.168.1.100.6379: Flags [S], seq 1024235732, win 14600, options [mss 1460,sackOK,TS val 774053164 ecr 0,nop,wscale 7], length 0
18:11:07.887968 IP 192.168.1.100.6379 > 192.168.1.110.56289: Flags [S.], seq 2275146780, ack 1024235733, win 14480, options [mss 1460,sackOK,TS val 773690698 ecr 774053164,nop,wscale 7], length 0
18:11:08.031127 IP 192.168.1.110.56287 > 192.168.1.100.6379: Flags [S], seq 1819611675, win 14600, options [mss 1460,sackOK,TS val 774053308 ecr 0,nop,wscale 7], length 0
18:11:08.071202 IP 192.168.1.110.56288 > 192.168.1.100.6379: Flags [F.], seq 75, ack 37, win 115, options [nop,nop,TS val 774053347 ecr 773690697], length 0
18:11:08.071382 IP 192.168.1.100.6379 > 192.168.1.110.56288: Flags [F.], seq 37, ack 76, win 114, options [nop,nop,TS val 773690881 ecr 774053347], length 0
18:11:08.908821 IP 192.168.1.110.42378 > 192.168.1.100.6379: Flags [S], seq 4151704632, win 14600, options [mss 1460,sackOK,TS val 773651397 ecr 0,nop,wscale 7], length 0
18:11:08.908837 IP 192.168.1.100.6379 > 192.168.1.110.42378: Flags [S.], seq 763390897, ack 4151704633, win 14480, options [mss 1460,sackOK,TS val 773691719 ecr 773651397,nop,wscale 7], length 0
我检查了一些服务器参数,如下所示:
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
客户方:
net.ipv4.tcp_timestamp = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
在此问题之前/之后,我检查了/ proc / net / netstat,然后增加了一些值(TW,DelayedACKs,TCPPrequeued,TCPHPHits,TCPPureAcks,TCPHPAcks)。
我也检查了积压溢出,但似乎不是那样。
# nstat -az TcpExtListenDrops
TcpExtListenDrops 0 0.0
什么可以被视为理由?我该如何确认?