Hi,
I'm writing an application to test a non-nio server. The server accepts
tcp connections ( ssl ) and uses a proprietary protocol to communicate
with an application running on a desktop pc.
To simulate the load of thousands of desktop pc's, I've written a MINA
application that creates thousands of connections.
Basically, it works fine on a small scale, but I've noticed some issues
with larger number of connections ( +1000 ) . I get spurious disconnects
and connections that hang, and general slowness. All errors occur on the
client side.
( the below code is greatly simplyfied - but it illustrates my point )
connector = new NioSocketConnector(10);
connector.getFilterChain().addLast("sslFilter", sslFilter);
handler = new TestAgentProtocolHandler();
connector.setHandler(handler);
for(Agent a : agents)
{
a.connect(connector);
}
By trying out diffent strategies, I've found that all the issues
disappear if I use a NioSocketConnector for each connection that I
make :
for(Agent a : agents)
{
connector = new NioSocketConnector(10);
connector.getFilterChain().addLast("sslFilter", sslFilter);
handler = new TestAgentProtocolHandler();
connector.setHandler(handler);
a.connect(connector);
}
This strategy has some unacceptable resource issues in itself, but it
has left me wondering if there is a scalability issue with
NioSocketConnector ? Is it designed for thousands of connections?
I did look briefly at the MINA source code, and tracing and profiling
did not reveal any obvious smoking guns. I'd like to investigate this
further, so any hints to where I could start looking is much
appriciated.
I'm using java5/MINA 2.0.0-M3 on a linux system.
thanks,
Peter