Hi!

This didn't get to the list, I think. I'd greatly appreciate your help.

Thanks,
Lóránt
--- Begin Message --- UPDATE: I seem to have gotten a bit confused here. Of course, I use only one SocketIoConnector, but there are different IoSessions for each connection. IoHandler.sessionClosed() gets called for each session, but the client side socket seems to never get released.

Regards,
Lóránt

Lóránt Pintér wrote:
Hi!

We have a little problem here with a stress test we'd like to do on our MINA-based server. There's a test client applicaiton that tries to connect to the server, execute some stuff, and then disconnect. This is repeated many times on 10 different threads.

After a few thousand of such tries all the threads start failing to connect to the server, one by one.

First, it seems that no exception is reported. The connection is done like this:

ConnectFuture connectFuture = connector.connect(address, this, connectorConfig);
        connectFuture.join();
        if (!connectFuture.isConnected())
            throw new ProtocolIOException("Cannot connect to server");

The exceptionCaught() method of the IoHandler is never caught, but connectFuture.isConnected() returns false.

After expecting and diving deep into MINA, we have found that a BindException is raised somewhere during connection, saying something like 'address already in use: no further information'.

One more piece of information that seems to be important: we create a new SocketIoConnector each time (I know this is bad practice), so by the time the connection problems start to occur, we have already created a few thousand SocketIoConnectors already. As the local ports allocated by the SocketIoConnector never gets released (they show up nicely with netstat -a), I simply run out of available ports.

I have three questions that I'd like you to answer:

1) Should I share one SocketIoConnector instance between all threads, or should I open one for each serivce thread? (Please take into consideration that I'm doing a stress-test, so I'd like to have the 'clients' working the most similar to as if they were running on different machines.)

2) Why does the BindException never get reported by IoHandler.exceptionCaught()? Should I submit a bug about this, or am I doing something completely wrong? Is there some other place I can catch it?

3) Is there a way that I can force the SocketIoConnector to shut down the associated socket?

Thanks,
Lóránt

begin:vcard
fn;quoted-printable:L=C3=B3r=C3=A1nt Pint=C3=A9r
n;quoted-printable;quoted-printable:Pint=C3=A9r;L=C3=B3r=C3=A1nt
org:Infomatix Kft.
adr;quoted-printable:;;J=C3=B3zsef krt. 53.;Budapest;;1085;Hungary
email;internet:[EMAIL PROTECTED]
title:Senior Developer
tel;cell:+36-20-428-7614
url:http://infomatix.hu/
version:2.1
end:vcard


--- End Message ---

Reply via email to