I have found a very strange problem. We found that the establishment time of the websocket connection between the mobile phone and the server was too long. Then I use tcpdump to capture the data and I discovered that the problem might have something to do with the window scaling option in the SYN package. Here is the SYN package for the websocket connection:
55488 → 443 [SYN] Seq = 0 Win = 65535 Len = 0 MSS = 1460 WS = 64 TSval = 570815281 TSecr = 0 SACK_PERM = 1
But the server did not respond with ack. Then several retransmissions of SYN occurred. Finally, the client sent a SYN retransmission:
55488 → 443 [SYN] Seq = 0 Win = 65535 Len = 0 MSS = 1460 SACK_PERM = 1
Then the server responded with ack.
I also captured other data from the HTTP connection and found that the window scaling option in the SYN package for the HTTP connection is "WS = 128". There is no retransmission in the link protocol for the HTTP connection.
So I just want to know the reason for that. The operating system on our server is CentOS version 6.7. The kernel version is 2.6.32-573.el6.x86_64.