RMI max server threads
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   nuno_oliveira
Posted On:   Monday, January 27, 2003 10:06 AM

I wanted to test how many threads an RMI server could spawn, so I set up a client that created a certain number of threads that called this same (empty) remote method. The results seem to indicate that the server cannot handle more than 23 threads, after which a "java.net.ConnectException: Connection refused: connect" message appears on the client side for the "surplus" thread. This seems a very low limit. Is it somehow configurable ? The complete exception stack trace is : java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185 )    More>>

I wanted to test how many threads an RMI server could spawn, so I set up a client that created a certain number of threads that called this same (empty) remote method. The results seem to indicate that the server cannot handle more than 23 threads, after which a
"java.net.ConnectException: Connection refused: connect"
message appears on the client side for the "surplus" thread. This seems a very low limit. Is it somehow configurable ?
The complete exception stack trace is :

			
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
at SInterfaceImpl_Stub.method(Unknown Source)
at MyThread.run(Client.java:53)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket. (Socket.java:290)
at java.net.Socket. (Socket.java:118)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
SocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
SocketFactory.java:122)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 5 more



Thanks.

   <<Less

Re: RMI max server threads

Posted By:   Edward_Harned  
Posted On:   Monday, January 27, 2003 01:50 PM

ConnectException is often a temporary condition.


We use a loop of say, ten tries, to overcome this condition. Catch the connectException and re-try the rebind.

About | Sitemap | Contact