I have a java process on machine A communicating with a Tomcat on machine B via TCP. The TCP connect (just the syn-syn/ack exchange) takes on the order of 100 ms consistently, while a ping request takes 1 ms (the serves are on the same LAN).
- What could cause the increased delay in establishing a TCP connection?
- How do I optimize it?
Note that:
- This is not yet a 3-way-handshake, I'm measuring only the syn/syn-ack exchange.
- The server is a very strong machine and not under load at all.
- The connect request is to an IP, not a hostname, so no DNS lookup is involved. In fact, this is not relevant since I'm measuring the time sine the SYN left machine A.