How many threads are you using?  Are you using a worker pool with a cap on the 
number of threads?  A machine can only handle about 2-3 thousand threads max.  
After that the kernel uses up all the CPU thread scheduling.

In most systems you want 1 thread per acceptor and a pool of 10-100 worker 
threads.  Ideally somewhere around 50 max if possible.  The more threads you 
have the more the CPU is thrashed with "wasteful" scheduling work.

Rob

----- Original Message ----
From: Richard Lowe <[EMAIL PROTECTED]>
To: [email protected]
Sent: Thursday, April 19, 2007 11:21:12 AM
Subject: Re: 1000+ simultaneous connections with data transfer?

Hi Trustin,

I have just tried upgrading to 1.0.3 and it didn't seem to make a lot of 
difference unfortunately.

To upgrade to 1.1.0 my application would need to move to JRE 1.5 so I 
would lose the 1.4.2 compatibility.

I'm happy to do this, but is it likely to bring me significant 
performance gains in this type of application?

Do you think the performance that I am seeing is normal?

Thanks again,
Richard.
--

Trustin Lee wrote:
> Hi Richard,
>
> Why don't you upgrade to 1.0.3 or 1.1.0?  We want to make sure that we
> are not chasing a bug already fixed.  :)
>
> Trustin
>
> On 4/19/07, Richard Lowe <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>
>> I am using Mina 1.0.0 under JRE 1.4.2 and testing it using a simple
>> server and client program that I have written.  I must say that Mina is
>> excellent, the API is very easy to work with.   I have a performance
>> question and am hoping that you guys might be able to supply me with an
>> answer.
>>
>> My server program starts up and waits for connections on a predesignated
>> TCP port (I use a class that extends IOHandlerAdapter to send events to
>> my server thread).  Every 1/4 of a second it will write ~ 128 bytes of
>> data to every connected session if the connection is a new session *or*
>> the session has successfully responded to a previous 128 byte packet
>> with a 64  byte packet of its own.    I use the following tweaks to help
>> improve performance:
>>
>> ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
>> ByteBuffer.setUseDirectBuffers(false);
>>
>> My client program (running on a seperate machine) creates 1000 instances
>> of an IoHandlerAdapter.  Every time it receives a 128 byte packet from
>> the server, it immediately responds with a 64 byte packet.
>>
>> To summarise, I'm sending 128 bytes per session every 1/4 of a second to
>> which I am receiving 64 bytes back.
>>
>> The test 'server' (more accurately desktop) is an AMD Athlon 3200+ (so
>> not the most powerful) and I am getting around 75% CPU utilisation with
>> 1000 connections.
>>
>> More specifically:
>>
>> 100: 4%, 200: 10%, 300: 22%, 400: 38%, 500: 43%, 600: 58%, 700: 65%,
>> 800: 66%, 900: 70%, 1000: 75%
>>
>> The bottleneck seems to be in the Mina layer or below.  Is the
>> performance above what you would consider to be 'optimal' or is there an
>> obvious way of substantially reducing CPU load?
>>
>> Ideally I would love to support 2000+ simultaneous connections on this
>> test machine.  Is there a way of achieving this without my CPU fan
>> flying off it's spindle and my machine setting alight?
>>
>> Any advice that you can offer would be very much appreciated!
>>
>> Cheers,
>> Richard.
>>
>
>





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to