taking a long time to send an object in rmi??

E

Elhanan

hi..
i tried to create a rmi server sample and a client, problem is if i try
to send an object (even one with no fields or nothing just a dummy) it
takes the server 60-80 seconds just to recieve it!! (this is between 2
computers).
 
R

Remon van Vliet

Elhanan said:
hi..
i tried to create a rmi server sample and a client, problem is if i try
to send an object (even one with no fields or nothing just a dummy) it
takes the server 60-80 seconds just to recieve it!! (this is between 2
computers).

That's way too long, you probably forget to flush your stream or otherwise
made a mistake within your IO code. How about you post the relevant bits of
your code so we can have a look?
 
E

Elhanan

i didn't flush anything, all i have is a method that simply accepts and
object and stores in a members.
and on the client i have somethign that sends a new object
this only happens with new objects btw, let's say for example i created
a new object and send it to the remote object, if i send the same
object again, i won't get a laaag.

but i created this becluse i have a closed java application which has
the same issues and i wanted to pin point where is the problem, on
another network, this takes around 200ms, but on this network it takes
such a long a time.

would you happen to know what in a network could cause this? (intranet
same building ).
 
O

Oliver Wong

Elhanan said:
i didn't flush anything.

Maybe that's your problem. You should be flushing after you finished
sending whatever it is you're trying to send.

- Oliver
 
E

EJP

Oliver said:
Maybe that's your problem. You should be flushing after you finished
sending whatever it is you're trying to send.

Err, no, this is RMI, there are no flushes, there are just remote method
calls.

Most RMI performance problems are in reality DNS problems. Check how
long it takes to ping the server host from the client.
 
T

Thomas Weidenfeller

Elhanan said:
but what if i use a actual ips? even then i get the same slowness

Get a network sniffer an check what is really going on.

/Thomas
 
G

Gordon Beaton

but what if i use a actual ips? even then i get the same slowness

Stop guessing and download Ethereal. Use it to see what is really
happening on the network while your call is taking time.

/gordon
 
E

EJP

Elhanan said:
but what if i use a actual ips? even then i get the same slowness

RMI (or something lower in the Java stack) does a reverse lookup on an
IP address so DNS is still involved.
 
R

Roedy Green

i tried to create a rmi server sample and a client, problem is if i try
to send an object (even one with no fields or nothing just a dummy) it
takes the server 60-80 seconds just to recieve it!! (this is between 2
computers).

In windows, you can set up some name:ip pairs in the hosts. file.
Presumably other OS have a similar mechanism for setting up high speed
DNS lookup on a few names.

see http://mindprod.com/jgloss/hosts.html
 
M

Martin Gregorie

Roedy said:
In windows, you can set up some name:ip pairs in the hosts. file.
Presumably other OS have a similar mechanism for setting up high speed
DNS lookup on a few names.
In and *nix you can do exactly the same in /etc/hosts

You can also run a local copy of named, the DNS server, which can be
configured to caches non-local name:IP pairs. This is the best solution
because it automatically tracks IP changes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top