Delays when remotely connecting to JBoss services (ejb beans or http) by IP address

When accessing your JBoss services from a different system, and the client system is running Windows (all versions), then it can happen that you have delays on some of your remote accesses.

When we had this (and we still do), the delays sometimes cause general slowness, but in some cases the delay can be up to 7s for one remote invocation. However, this delay is not consistent. The delays can be very machine dependent (or possibly Windows variant dependent), and sometimes occur on most (or all invocations), and sometimes it is quite exceptional. In short, a real debugging headache.

First thing to do was checking whether the delays were on the client or server side. Thanks to Wireshark, this was relatively easy to figure out. As it appears, the delays were entirely on the client side. After some digging in the packages being sent, it appears that the cause of the problem is trying to access the server using a IP address. Apparently, Windows tries to do a reverse dns lookup, and in some cases this can take some time.

There are two possible solutions. Either you have to make sure that all the systems use a dns server in the local network and that the server is part of you local dns, or you have to edit the c:\windows\system32\drivers\etc\hosts file (on some nt/win2K this may be under c:\winnt) and add a name mapping for the ip address there.

Unfortunately this means that, if you were not already using a local dns or dns proxy for other reasons, that each of the client systems needs to be configured to access the server. Aargh.

In general, if you notice slowness when remotely accessing JBoss by IP address, check that a reverse dns lookup succeeds. Windows sometimes caches the result, but not always, and even when caching, it retries frequently.

This is clearly a Windows and not a java problem, as it not only occurs when accessing beans, but also when using web services or a web client (like Firefox). I am certain it also applies for other application server. The problem has however not been tested using linux clients, so I cannot comment whether they also suffer from this problem.

Leave a Reply

Your email address will not be published. Required fields are marked *

question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen

*