简体   繁体   中英

Very slow TCP handshake in Java application

Our Java application consists of a client and a server. In our production environment, establishing the connection takes a long time (~40 seconds).

We captured the network traffic using tcpdump and can see the following packets when the connection is established:

start                  client > server SYN
2 milliseconds later   server < client SYN,ACK
38 *seconds* later     client > server ACK

In our other environments, all three packets occur nearly instantaneously.

Can anyone suggest what might cause the 38 second delay, or suggest steps to diagnose it? Note that, because this is a production environment, it's hard for us to make diagnostic code changes.

Here are some details about our environment:

  • The client uses SocketConnector from Apache Mina 1.0.1, which internally uses java.nio.channel.SocketChannel.connect(..).
  • The client is running inside IBM WebSphere 7.0.0.17
  • Java version = 1.6.0, Java Compiler = j9jit24, Java VM name = IBM J9 VM
  • OS is AIX, version 6.1

您是否用尽了描述符和/或TCP接受队列已满?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM