You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Wang Henry <ap...@hotmail.com> on 2006/09/05 09:09:28 UTC

Mina Server CPU Usage 80%

Dear support,

Recently I tested the echo server with build mina-0.9.4-all on a single CPU 
windows XP machine. However, after concurrent connection reaches 1000, the 
acceptor becomes slow and CPU reaches 80%. After I tried to add the thread 
pool filter with 2 threads, still same. I wonder that is the limitation of 
Java 1.5 NIO or I need do more things to make it CPU usage low. 

By the way, mina-0.9.4 is considered to be a release version? 

Thanks.

Henry

_________________________________________________________________
怕 Hotmail 信箱失效?:MSN Hotmail Plus:讓你的 Hotmail 信箱永遠不逾期 
http://join.msn.com/?pgmarket=zh-tw 


Re: Mina Server CPU Usage 80%

Posted by Vinod Panicker <vi...@gmail.com>.
On 9/5/06, Mike Grundvig <mi...@electrotank.com> wrote:
> Can you explain the Executor pool tweak or point a link to it? Thanks!

There a mina submodule named 'java5' which has the implementation of
the Executor based thread pool. At the moment though, if you want to
make use of this in your application, you can patch mina using the
patch available in this issue -
http://issues.apache.org/jira/browse/DIRMINA-251

>From your application, you will need to do something like this -

SocketAcceptorConfig config = new SocketAcceptorConfig();
PooledThreadModel pooledThreadModel = PooledThreadModel.getInstance(
threadServiceName );
pooledThreadModel.setThreadPoolFilter( new ThreadPoolFilter( new
ExecutorThreadPool( new ThreadPoolExecutor( 21, Integer.MAX_VALUE
,60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>( true ) ) ) )
);
config.setThreadModel( pooledThreadModel );

HTH,
Vinod.

Re: Mina Server CPU Usage 80%

Posted by Mike Grundvig <mi...@electrotank.com>.
Can you explain the Executor pool tweak or point a link to it? Thanks!

Michael Grundvig
Electrotank, Inc
http://www.electrotank.com


----- Original Message ----- 
From: "Vinod Panicker" <vi...@gmail.com>
To: <mi...@directory.apache.org>
Sent: Tuesday, September 05, 2006 4:21 AM
Subject: Re: Mina Server CPU Usage 80%


> Hi,
>
> I wouldn't say its a MINA problem because I've been able to reach
> thousands of concurrent connections without any problems from MINA.
> You would see better performance if you use the Executor based thread
> pool.
>
> 0.9.4 is being used in production environments and is quite stable,
> except for an issue which you work around by using the Java5 Executor
> based pool.
>
> Regards,
> Vinod.
>
> On 9/5/06, Wang Henry <ap...@hotmail.com> wrote:
>> Dear support,
>>
>> Recently I tested the echo server with build mina-0.9.4-all on a single 
>> CPU
>> windows XP machine. However, after concurrent connection reaches 1000, 
>> the
>> acceptor becomes slow and CPU reaches 80%. After I tried to add the 
>> thread
>> pool filter with 2 threads, still same. I wonder that is the limitation 
>> of
>> Java 1.5 NIO or I need do more things to make it CPU usage low.
>>
>> By the way, mina-0.9.4 is considered to be a release version?
>>
>> Thanks.
>>
>> Henry
> 



Re: Mina Server CPU Usage 80%

Posted by Vinod Panicker <vi...@gmail.com>.
Hi,

I wouldn't say its a MINA problem because I've been able to reach
thousands of concurrent connections without any problems from MINA.
You would see better performance if you use the Executor based thread
pool.

0.9.4 is being used in production environments and is quite stable,
except for an issue which you work around by using the Java5 Executor
based pool.

Regards,
Vinod.

On 9/5/06, Wang Henry <ap...@hotmail.com> wrote:
> Dear support,
>
> Recently I tested the echo server with build mina-0.9.4-all on a single CPU
> windows XP machine. However, after concurrent connection reaches 1000, the
> acceptor becomes slow and CPU reaches 80%. After I tried to add the thread
> pool filter with 2 threads, still same. I wonder that is the limitation of
> Java 1.5 NIO or I need do more things to make it CPU usage low.
>
> By the way, mina-0.9.4 is considered to be a release version?
>
> Thanks.
>
> Henry