• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

is RMI this slow????

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I just finished designing/implementing my assignment and now I am starting to test it in an actual network environment. I am running windows 2000 machines for both server and client(s).
When I start the application and get the initial connection to the server by doing Naming.lookup, that takes over 30 seconds to get a reference to the remote object.
Not only that, the first search performed takes a long time as well. After that searches run very fast, as if they are running locally.
Any ideas? I tried adding the ip address and server name to my hosts file since I heard that even though I am specifying the IP address, windows would still do a reverse lookup to get the host name. But that didnt help at all.
Any help will be greatly appreciated!
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from the java RMI FAQ.

C.6 Why do Naming.bind and Naming.lookup take an extraordinarily long time on Windows?
Most likely, your host's networking setup is incorrect. RMI uses the Java API networking classes, in particular java.net.InetAddress, which will cause TCP/IP host name lookups - both host to address mapping and address to hostname mapping (the InetAddress class does this for security reasons). On Windows, the lookup functions are performed by the native Windows socket library, so the delays are happening not in RMI, but in the Windows libraries. If your host is set up to use DNS, then it is usually a problem with the DNS server not knowing about the hosts involved in communication, and what you are experiencing are DNS lookup timeouts. Try specifying all the involved hostnames/addresses in the local file \winnt\system32\drivers\etc\hosts or \windows\hosts. The format of a typical host file is:
IPAddress Machine Name
e.g.: homer
This should dramatically cut down the time it takes to make the first lookup.

Alex Silva
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marcos,
That fixed it. What I had done before was entering the server name on the client's hosts file only; but you actually have to enter the client's name on the server's host file too.
That was a headache, glad it is over now!
This tiny ad is guaranteed to be gluten free.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic