java - TCP Connect takes X100 longer than ping -


I have a Java process on the machine that communicates with TOMcat on machine B. through TB ​​I connect TCP (Only sync-sync / AX exchange) takes the order of 100 ms continuously, while a ping request takes 1 ms (the service is on the same LAN).

  1. Could there be a delay in setting up a TCP connection?
  2. How do I optimize it?

Note that:

  • This is not yet a 3-way handshake,
  • The server is a very strong The machine is and is not subject to load.
  • The connection request is for an IP, not a hostname, so no DNS lookup is included. In fact, it is not relevant because I measure the time of SYN left machine A.
  • It seems that the problem is not in the client or server itself, on the client and server Put two packet dumps:

    1. The client sees the time difference between 100-150 ms to see the SYN and obtain the SYN / ACK.
    2. The server sees only time difference of 20ms between receiving SYN and sending SYN / ACK.

    Therefore, the problem should be in some intermediate layer (router / firewall / keynote).


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -