Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Decrease time out period if server is not registered in the rmiregistery

Thread view: 
ashwin.dasanahalli@gmail.com - 21 Mar 2007 08:24 GMT
I have written a tiny RMI client. Before I bind to the RMI server, I'm
doing a Naming.lookup to check if the server is registered. It is
taking too much time to throw an exception if the server is not
registered in the rmiregistery. Is there any way I can decrease this
time???

Any help will be appreciated..........

Thanks
Ashwin
Esmond Pitt - 22 Mar 2007 01:27 GMT
> I have written a tiny RMI client. Before I bind to the RMI server, I'm
> doing a Naming.lookup to check if the server is registered. It is
> taking too much time to throw an exception if the server is not
> registered in the rmiregistery. Is there any way I can decrease this
> time???

How much time is too much? It should take less than a second if the
registry is running.
ashwin.dasanahalli@gmail.com - 22 Mar 2007 12:01 GMT
On Mar 22, 5:27 am, Esmond Pitt <esmond.p...@nospam.bigpond.com>
wrote:
> ashwin.dasanaha...@gmail.com wrote:
> > I have written a tiny RMI client. Before I bind to the RMI server, I'm
[quoted text clipped - 5 lines]
> How much time is too much? It should take less than a second if the
> registry is running.

Thanx for a quick reply.
I have an up and running registry. Lets say, the server fails to
register itself with the rmiregistery. Now when the client tries to
lookup this server in the registry, it will fail. The amount of time
Naming.lookup is taking to throw an exception is approx 2mins.  My
concern is to reduce this time. Is there a way to do it?
Esmond Pitt - 23 Mar 2007 00:51 GMT
> On Mar 22, 5:27 am, Esmond Pitt <esmond.p...@nospam.bigpond.com>
> wrote:
[quoted text clipped - 16 lines]
> Naming.lookup is taking to throw an exception is approx 2mins.  My
> concern is to reduce this time. Is there a way to do it?

How much time does it take if the lookup is successful?

RMI delays of this order are almost always due to incorrect DNS
configuration, not RMI itself.
ashwin.dasanahalli@gmail.com - 27 Mar 2007 10:15 GMT
On Mar 23, 4:51 am, Esmond Pitt <esmond.p...@nospam.bigpond.com>
wrote:
> ashwin.dasanaha...@gmail.com wrote:
> > On Mar 22, 5:27 am, Esmond Pitt <esmond.p...@nospam.bigpond.com>
[quoted text clipped - 24 lines]
>
> - Show quoted text -

If the server is registerd in the rmiregistery, it takes hardly a
fraction o second to lookup and respond back with result!!!
Esmond Pitt - 28 Mar 2007 04:06 GMT
> If the server is registerd in the rmiregistery, it takes hardly a
> fraction o second to lookup and respond back with result!!!

If the registry is running and the server is not registered in it, it
should take more or less exactly the same time as if the server is
registered. It just has to transmit an exception instead of a remote
stub. I've never seen it take longer in ten years of using and writing
about RMI, and I've never seen a reason in the RMI source code why it
would. Are you sure you aren't retrying or doing something else at the
application level in the NotBound case?
steve - 23 Mar 2007 04:23 GMT
> I have written a tiny RMI client. Before I bind to the RMI server, I'm
> doing a Naming.lookup to check if the server is registered. It is
[quoted text clipped - 6 lines]
> Thanks
> Ashwin

we did an analysis of this problem about a year ago, in the java group.   it
is a problem with  various windows platforms and the implementation of the
look-up, if the ip port does not respond.

Even setting a time-out value on a port you open will not circumvent the
problem.

as i say It was worse on  windows, and non-existent on OSX, but recently even
that platform is ignoring the time out values, so that if it is set for 5
seconds , it can still take like 30!!!

AHHHH you lucky guy, I still have the  notes from another java group.
here we found 4 seconds on an internal network.

/* bug found on windows!!
Output for this always is something like
< ----------------------------------------------------------------
4802
282
281
282
266
282
281
282
281
282
282
4771
problem found: the JVM is running on Windows XP with netbios over
TCP/IP activated. On connect() the JVM tries to resolve the hostname
(java.net.InetAddress.getHostFromNameService, getHostByAddr).

Windows tries a netbios ns query on udp port 137 with a timeout of
1500ms, ignores any ICMP "port unreachable" packages and repeats this
two more times, adding up to a value of 4.5 seconds (!).

Deactivating netbios "fixes" this, but isnŽt always an option ... any
ideas very welcome.

*/

Steve

Steve


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.