Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ConnectException---help!!

 
cindy sung
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My program works fine when I test it byhand. But now I created a testing program that generates 100 threads to connect to the remote server at the same time and try to book a ticket. But only some threads can connect to the server and function well. Some other threads will get 'ConnectException' when 'Naming.lookup' is called. I think this may be because the server only allows a small number of clients connecting to it at one time. Can somebody tell me how do I increase the number of connections allowed? Or is it because of some other reasons?
Thanks.
cindy
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But only some threads can connect to the server and function well. Some other threads will get 'ConnectException' when 'Naming.lookup' is called. I think this may be because the server only allows a small number of clients connecting to it at one time. Can somebody tell me how do I increase the number of connections allowed? Or is it because of some other reasons?

Apparently Sun's implementation of RMI is deficient. Under a heavy load, RMI chokes, and refuses the connections. I think we all experienced that if we create many threads in sequence. That's one of the resons Weblogic has its own (better) RMI implementation.
You could do two things:
1. Do not use more than say 25 threads.
2. Create 100 threads, but sleep() a little bit after creation of each (give RMI a break
)
Eugene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic