Score:0

The TCP receiver only ack the minimum bytes of MSS one by one

cn flag

The client and server nodes are CentOS7.9/X86_64. If the HTTP POST requests were sent directly to the server, there are about 0.2% of cases that may timeout. If the HTTP POST requests were sent through an NGINX proxy on the client node, there are about 20% of cases will timeout. I've confirmed that only one backend node has this problem. All other nodes are 100% succeeded even with higher throughput.

After tcpdump on the backend nodes and with Wireshark analysis. for a successful request, the tcp package is received normally. as below:

enter image description here

That is to way, the TCP receiver sends ACK to each large tcp payload.

for a failed request, the tcp receiver only ack 1398 size for each tcp packet. 1398 is the minimum tcp payload as the MSS minus TCP/IP header. ( 1410 - 66 = 1398), as below:

enter image description here

The TCP sender sends TCP retransmission 8 times in 60 seconds but the TCP receiver never sends ack back again. The HTTP Server closed the connection for 60 seconds of reading timeout.

It looks like the packets were lost in the kernel TCP stack instead of in the network way since the packets were captured on the server-side node. And on the client node, it's observed with tcpdump that the client received each ack from the server quickly.

Can anyone help with this? thanks in advance.

Score:0
cn flag

Here's the root cause:

  1. the client side (nginx) does not send a PSH flag.

  2. the server side enlarges the TCP window size in order to receive more bytes and does not send ACK back.

  3. the client sends more bytes.

  4. the server receives more bytes and enlarges the window size. but did not send ACK flag.

  5. after 100ms, the client side considers the packets lost and resends the packets.

  6. the server send 'Duplicate ACK' and continue to enlarges the window size since it received more bytes despite the bytes duplicated.

  7. the server sends 'Duplicate ACK' and continue to enlarge the window size since it received more bytes despite the bytes duplicated.d both of them starve to death.

The solution:

nginx does not send PSH even open the configuraiton.

configure on the server side to reduce the max tcp window size to 32k resolved the problem.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.