mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bauroth <michael.baur...@falcom.de>
Subject Experiences with bulk connections
Date Fri, 20 Oct 2006 09:13:14 GMT
Hi,

I started 2 days before with migration from version 0.9.5 to 1.0.0.
Up to this point I had a test system with both parts (client and server) 
on same machine.

Here some short details:

Debian 3.1
JDK 1.5.6
2 GB RAM
1 Xeon

Each time when I started the tests, the first step was to establish as 
quick as possible 20000 connections between client and server (as a 
worst case scenario).
Establishing means in this context, that the returned ConnectFuture is 
joined correctly.

Here is the code snippet for this:

<code>
ConnectFuture future = connector.connect( adr, handler, config );
future.join();
</code>

For my described system I experienced an averaged time of 120 seconds 
until this step finished.

Now I changed the Mina version, removed the backport but keeped the rest 
as it is (default threadpools and so on).

Now the same test needed 450 seconds until success!

I changed my code again (move the join() method in an extra step):
<code>
ArrayList<ConnectFuture> futurelist = new ArrayList<ConnectFuture>();
for ( int i = 0; i < 20000; i++)
{
     futurelist.add( connector.connect( adr, handler, config ) );
}
</code>

When the list was filled, I started a thread, which should cycle through 
the futurelist as often as there are still unjoined futures available. 
If one future was ready and connected, it was be removed from the list.

Now the time decreased again to a value of 100-200 seconds.

I noticed while this tests, that the first futures were removed very 
quickly (hundreds in a few milliseconds), but with ongoing time the rest 
needed more and more time until connect - up to 20 seconds for the last 
100 connections(!).

I changed the test again. Now I used a quartz trigger to establish 
exactly 1 connection per millisecond (1000 per second) without join. 
After 20 seconds this process was finished. When I checked now the 
connected and ready futures, over 19900 were already finished! After 
another 5 seconds all connections were up and running.

So this test finished after only 25 seconds at all!!!


My question behind this tests is: Can it be, that Mina has a little 
problem with flooding connection requests? Or do you think, that it is 
the operating system?

Best Regards
Michael




Mime
View raw message