You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by pietry <pi...@death-squad.ro> on 2007/11/10 18:44:13 UTC

Performance problem

I have read the configure thread model tutorial, and i dont know exaclty what
to pick for my server program. I have lots of connections ( like 1000) and i
want to get even more ( upto 5000, 10000).
The main problem is that at about 500 connections, broadcast messages get
cpu to 100 % usage. I've tried the cachedthreadpool, but from what i can
see, the mina keeps only about 30-35 threads even though i have 500 clients.
I keep a class for each client in a linked list, and attach it to each
session, in broadcast messages i must get through all the list.
What should i do to avoid this situation ( 100 % cpu usage )?
Thanks
-- 
View this message in context: http://www.nabble.com/Performance-problem-tf4783282s16868.html#a13684209
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Performance problem

Posted by pietry <pi...@death-squad.ro>.
After some undergo tests, my conclusion is that the write() operation to each
session is the one who gets the most cpu usage. My question is why ?
Is there a way i can avoid this usage on simple i/o operations ?
-- 
View this message in context: http://www.nabble.com/Performance-problem-tf4783282s16868.html#a13702958
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Performance problem

Posted by pietry <pi...@death-squad.ro>.


Emmanuel Lecharny-3 wrote:
> 
> pietry wrote:
>> But this shouldnt be happening right ? 
> What should not happen ? he 100% CPU usage? certainly. Biut the 
> interesting question is 'why does _your_ server use 100% of the CPU. In 
> other terms, what is your server doing ?
> 
> As i said, my server accepts connections from a large number of clients,
> and sends either messages from one to another, or broadcast messages to
> all clients. Text messages, at a rate of 3-10 messages per second ( the
> number grows with clients )
>> So mina supports what i want for my
>> server.
>> Did i choose the right settings?
>>   
> No idea. Again, it all depends on what your server is doing, and we have 
> no clue about that.
> 
>> I tried to create an executor filter with a different thread pool, but no
>> difference
>> When i rapidly broadcast messages, the cpu grows to 100 % and if stop, it
>> drops to 0.
>>   
> Which kind of messages ? Which size? Which treatment are you doing on 
> those messages? These are the key questions...
> 
> Can you provide a little bit more context?
> Text messages, size varies from 20 bytes to even 2 kBytes, im doing no
> treatment.
> 
> -- 
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Performance-problem-tf4783282s16868.html#a13689158
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Performance problem

Posted by Emmanuel Lecharny <el...@gmail.com>.
pietry wrote:
> But this shouldnt be happening right ? 
What should not happen ? he 100% CPU usage? certainly. Biut the 
interesting question is 'why does _your_ server use 100% of the CPU. In 
other terms, what is your server doing ?

> So mina supports what i want for my
> server.
> Did i choose the right settings?
>   
No idea. Again, it all depends on what your server is doing, and we have 
no clue about that.

> I tried to create an executor filter with a different thread pool, but no
> difference
> When i rapidly broadcast messages, the cpu grows to 100 % and if stop, it
> drops to 0.
>   
Which kind of messages ? Which size? Which treatment are you doing on 
those messages? These are the key questions...

Can you provide a little bit more context?


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: Performance problem

Posted by pietry <pi...@death-squad.ro>.
But this shouldnt be happening right ? So mina supports what i want for my
server.
Did i choose the right settings?
I tried to create an executor filter with a different thread pool, but no
difference
When i rapidly broadcast messages, the cpu grows to 100 % and if stop, it
drops to 0.
That looks normal ? ( I think its possible that because of passing through
all linked list this could happen )
-- 
View this message in context: http://www.nabble.com/Performance-problem-tf4783282s16868.html#a13685229
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Re: Performance problem

Posted by Emmanuel Lecharny <el...@gmail.com>.
pietry wrote:
> I have read the configure thread model tutorial, and i dont know exaclty what
> to pick for my server program. I have lots of connections ( like 1000) and i
> want to get even more ( upto 5000, 10000).
> The main problem is that at about 500 connections, broadcast messages get
> cpu to 100 % usage. I've tried the cachedthreadpool, but from what i can
> see, the mina keeps only about 30-35 threads even though i have 500 clients.
> I keep a class for each client in a linked list, and attach it to each
> session, in broadcast messages i must get through all the list.
> What should i do to avoid this situation ( 100 % cpu usage )?
>   
May be check your server code to see what is consuming 100% CPU ? MINA 
is just a network layer, and the CPU usage depends largely on what you 
do on top of it...

At least, just try with a 'dummy' server (ie, something which does 
nothing), and check if MINA is the place where those 100% CPU are eaten.
> Thanks
>   


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org