Re: How to increase MINA application performance

2008-01-14 Thread Maarten Bosteels
Nikfarjam,

If your system has 2Gb of RAM, why are you only assigning 512M of it
to the JVM ?

Maarten

On Jan 14, 2008 8:59 AM, Nikfarjam <[EMAIL PROTECTED]> wrote:
>
> Dear Mr Lécharny
> Thanks for guidance.
> Our project is producing a gateway with
>  payload < 256 byte
>  avg 2000 msg/s
>  with limited clients (less than 10)
>
>  Reliability and performance are two key factors for us.
>
>  The machine that we used for running our application had these
> specifications:
>  - CPU Intel(R) Xeon(R) 5160 3.00GHz  (4 cores)
>  - Ram 2GB
>  - OS Debian
>  - JRE 6 with JVM options
>  > -server -Xms512m -Xmx512m -Xss128k -XX:+AggressiveOpts -XX:+UseParallelGC
> -XX:+UseBiasedLocking  -XX:NewSize=64m
>
>  And we faced these problems:
>  - a huge difference between our result and
> http://mina.apache.org/documentation.data/ACAsia2006.pdf ACAsia2006.pdf 's
> result. (page 7)
>  our message per second is less than 1000.
>  - Memory heap error witch we mentioned before.
>  best regards.
> --
> View this message in context: 
> http://www.nabble.com/How-to-increase-MINA-application-performance-tp14796729s16868p14796729.html
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>


Re: How to increase MINA application performance

2008-01-14 Thread Emmanuel Lecharny

Nikfarjam wrote:

Dear Mr Lécharny
Thanks for guidance.
Our project is producing a gateway with
 payload < 256 byte
 avg 2000 msg/s
 with limited clients (less than 10)

 Reliability and performance are two key factors for us.

 The machine that we used for running our application had these
specifications:
 - CPU Intel(R) Xeon(R) 5160 3.00GHz  (4 cores)
 - Ram 2GB
 - OS Debian
 - JRE 6 with JVM options
 > -server -Xms512m -Xmx512m -Xss128k -XX:+AggressiveOpts -XX:+UseParallelGC
-XX:+UseBiasedLocking  -XX:NewSize=64m

 And we faced these problems:
 - a huge difference between our result and 
http://mina.apache.org/documentation.data/ACAsia2006.pdf ACAsia2006.pdf 's

result. (page 7)
 our message per second is less than 1000.
  
FYI, we are reaching more than 4500 msg/s on Apache Directory Server, 
which use Mina 1.1.4. Considering that a hell lot of processing is done 
on the backend part of our server, I'm pretty confident that Mina can 
process largely more than 10 000 req/s.


I'm wondering if you have not some kind of bottleneck somewhere in your 
program : likely the number of threads you are using to process the 
messages. Which kind of CPU load do you have when running your server? 
Is the System CPU is above 15% ? When you generate a HeapDump, how many 
threads are running concurrently ? Otherwise, if you get a OOM, may be 
you are not releasing the connections after having closed them, leading 
to such a problem.


Anyway, Maarten is right, as you have 2Gb on your box, use it for your 
Java app. As it's somehow a critical system for you, I don't think any 
other process will use the remaining 1.5 Gb ...


There are so many different potential problem that it's almost 
impossible, without the code, to tell what can goes wrong in your 
server. And getting the full code of your server won't help anyway, 
unless you strip everything which is not MINA related, and if you are 
not able to reproduce the very same problem in the smallest possible 
code base.


Keep in mind that MINA is widely used by people who have the very same 
requirements you have, and they are quite happy with it. You may have 
found a memory leak in MINA itself, but I would say it's very unlikely. 
Keep searching in your own code, this is a 99% way to get the solution. 
If you fell into the unpleasant 1%, I hope that while doing your 
experiments, you will find the MINA piece of code we have to fix, and 
you will provide us with that fix !




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