mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 凌晨 <lingc...@usertunnel.com>
Subject Re: Experiences with bulk connections
Date Fri, 20 Oct 2006 09:44:17 GMT
Hi there
Just yesterday I did almost the same test.Established 1000 connections per
second and 20000 at all,every connetion sent small data package as soon as
connected to register itself to the
server(HashMap<String,Iosession>).During the whole procedure,many a former
connected IoSession stored in HashMap had been closed abnormally and
unexpectedly and there only no more than
200 connections remained in HashMap at last.I have been revising  my codes
by now.
Best Wishes,
James Ling
----- Original Message ----- 
From: "Michael Bauroth" <michael.bauroth@falcom.de>
To: <mina-dev@directory.apache.org>
Sent: Friday, October 20, 2006 5:13 PM
Subject: Experiences with bulk connections


> 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