RMI using Spring is slow

I use RMI and I noticed this very, very slowly. A simple call takes ~ 8-10 seconds to get a response. This is not the method that I have been calling for so long. If I use RMI but point to a call to 127.0.0.1, it is very fast (the method that I call is not complicated in any case).

So ... what could be the reason? My downdraft is fast enough, the remote machine upstream fast enough ... and the remote machine is not too busy with other things.

Anything I could do wrong? Or something to pin it a little?

+4
source share
3 answers

Does the remote computer have IPv6 DNS (AAAA) records? You may get this delay when trying to talk to a dual-stack machine (IPv4 and IPv6) if you are not able to connect IPv6. IPv6 will be checked first, then when it expires in a few seconds, the connection will be made through IPv4.

+2
source

Are you referencing the remote computer through DNS or are you using raw IP addresses? Perhaps what slows down is DNS name resolution.

+1
source

Maybe your firewall, or some proxies get in the way. Do you have marks on the input and output of the method, which are registered both on the client and on the server? Try using Wireshark to view packets, in particular TCP acknowledgment SYN -> ACK -> SYN/ACK .

+1
source

All Articles