my dog learned polymorphism*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes simulating multiple clients with RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "simulating multiple clients with RMI " Watch "simulating multiple clients with RMI " New topic
Author

simulating multiple clients with RMI

Peter Aarum
Ranch Hand

Joined: Jan 14, 2010
Posts: 44
Hello all!

First I made a socket implementation and then I decided that in order to choose between the two I must implement a RMI solution. I have now done that. And now to my question:
when I try to simulate multiple clients (by creating threads in a loop) and try to book a room it seems to work fine when I try it with 500 threads. Ant then I tried it with 700 I got alot of
java.rmi.ConnectException: Connection refused to host: xx.xxx.xxx.x; nested exception is:
java.net.ConnectException: Connection refused: connect

This is ofcourse from the client threads. The server does not throw any exceptions. Is this something that I need to worry about? With my socket solution I could run it with 10.000 threads.....

Any thoughts?

Have a great saturday folks!
/Peter
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5521
    
  13

I never tested my RMI solution with that amount of threads, so I don't have any idea (but it seems a bit odd to me). Maybe you could try to simulate the issue with a very easy RMI example (like this one)


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Peter Aarum
Ranch Hand

Joined: Jan 14, 2010
Posts: 44
Thanks for the reply Roel!

I will try that and post the result when I got time..... going on a short holiday.

Cheers!
Peter

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5521
    
  13

Peter Aarum wrote:going on a short holiday.

Enjoy! Don't forget your and have a once in a while
Peter Aarum
Ranch Hand

Joined: Jan 14, 2010
Posts: 44
Hi!

Back after alot of

I have now tested the simple RMI example and here are the results.

500 threads - no problem.
700 threads - no problem
1000 threads - multiple exceptions like above.

Since this worked with 700 I run the URLyBird test again and it worked with both 700 and 900 and it worked fine but not with 1000..... hmmm I dont know what to think about this. Otherwise I like the RMI solution a little better than the socket.....

Any thoughts/ideas?

Cheers!
Peter

Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2267
    
    3

Well champ, you can stay with the RMI solution. A super powerful server is not a must requirement, so I'd say that what you have is certainly enough. You can even mention what they can expect from your solution, and since it wasn't mentioned how many requests the server has to handle concurrently, then you concluded that what you built was enough.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5521
    
  13

I experience exactly the same behavior: when you start 750 threads accessing the RMI server (with the simple example) you get a lot of "connection refused" exceptions. No need to say I didn't test my RMI server with that many concurrent requests. I tested it with maximum 35 threads.
Peter Aarum
Ranch Hand

Joined: Jan 14, 2010
Posts: 44
Hi Roberto and thanks for the reply!

Yeah I suspect that this test does not really test a reasonable scenario. What are the odds that 1000 clients connects almost simultaneously?

Cheers!
Peter
Oricio Ocle
Ranch Hand

Joined: Nov 30, 2004
Posts: 284

Hello.
this is classic: More than 17 clients CRASH
But seems not to find an explanation.

Maybe the problem is caused at a lower level, an antivirus, or even the OS, identifying a threat as DoS attack.

Increasing heap space (server/client) changes the result?

┬┐What jre version is?

Regards!


SCJP, OCMJD, OCMJEA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simulating multiple clients with RMI