Hi 

Fixed my 100% CPU problem. It was because my performance test client was not 
implemented properly and also I had to use the CachedThreadPool for my 
IoAcceptor.
Using the Your Kit JavaProfiler and quite pleased with it.


Regards
Arul

http://www.lulu.com/java-success

Get a free download of Java/J2EE interview Questions answered with diagrams, 
code, examples, tips etc download --> 

http://www.lulu.com/items/volume_54/821000/821310/1/preview/978-1-4116-6824-9-preview.pdf




P PLEASE CONSIDER THE ENVIRONMENT BEFORE YOU PRINT THIS E-MAIL

>  -----Original Message-----
> From:         Kumaran Arul  
> Sent: Friday, 27 April 2007 11:42 AM
> To:   '[email protected]'
> Subject:      Please help using MINA in a large mission critical project
> Importance:   High
> 
> 
> Hi
> 
> Any hints will be really appreciated.  I am using MINA 1.1.0 and carrying out 
> some performance tests.
> 
> 
> When I run the client and the server on the same machine it performs lot 
> better than having both the client and the server on separate machines?
> 
> 
> Also if I hit the server with 100 concurrent requests straight away it stalls 
> with 100% CPU utilization. But if I send a first single request and 
> subsequently send 100 concurrent requests it works fine.
> 
> My code is show below. Any recommendations or suggestions will be greatly 
> appreciated.
> 
> 
> 
> Thanks
> ak
> 
> 
> P PLEASE CONSIDER THE ENVIRONMENT BEFORE YOU PRINT THIS E-MAIL
> 
>        -----Original Message-----
>       From:   Kumaran Arul  
>       Sent:   Tuesday, 24 April 2007 6:32 PM
>       To:     '[email protected]'
>       Subject:        CPU usage 100%
>       Importance:     High
> 
> 
>       Hi
> 
>       I am using MINA 1.1.0 and works well in Windows environment when I use 
> 200 concurrent requests. Takes 0.45ms per request.
> 
> 
>       But when I deployed my application to the HP UX machine it runs fast 
> for first 100 requests and the CPU gets to 100% and slows the whole 
> application down drastically (i.e. 30 seconds a request). Any suggestions 
> will be greatly appreciated.
> 
> 
>       I am running with 15-25 worker threads 
>       and IOThreads = number of CPUs
> 
> 
>       Sample code  below:
> 
>                   ExecutorService ioExecutor = 
> Executors.newFixedThreadPool(noOfIoThreads + 1);
> 
>                       ExecutorService serviceExecutor = 
> Executors.newFixedThreadPool(noOfWorkerThreads);
> 
>                       IoAcceptor acceptor = new SocketAcceptor(noOfIoThreads, 
> ioExecutor);
>                       SocketAcceptorConfig config = new 
> SocketAcceptorConfig();
> 
>                       config.setThreadModel(ThreadModel.MANUAL);
>                       config.getSessionConfig().setTcpNoDelay(false);
>                       config.getSessionConfig().setReuseAddress(true);
>                       
>                       DefaultIoFilterChainBuilder chain = 
> config.getFilterChain();
>                       addLogger(chain);
>                       // config.getFilterChain().addLast("compression", new 
> CompressionFilter());
>                       config.getFilterChain().addLast("threadPool", new 
> ExecutorFilter(serviceExecutor));
>                       
>                       SocketAddress sa = null;
> 
>                       try {
>                               sa = new InetSocketAddress(portNo);
>                               //
>                               
>                               //Bind
>                               acceptor.bind(sa, new PayAtPumpTxnHandler(), 
> config);
>                       }
> 
>                       catch (IOException ioe) {
>                               acceptor.unbind(sa);
>                               serviceExecutor.shutdown();
>                               ioExecutor.shutdown();
>                               throw new RuntimeException("Error starting the 
> listener " + listenerName + " on host=" + 
> ((InetSocketAddress)sa).getHostName() +   " on port number=" + portNo + ioe);
>                       }
> 
>                       finally {
>                               logger.info("Listener " + listenerName + " 
> started on host=" +  ((InetSocketAddress)sa).getHostName() +   " port 
> number=" + portNo);
>                       }
> 
> 
> 
> 
> 
>       P PLEASE CONSIDER THE ENVIRONMENT BEFORE YOU PRINT THIS E-MAIL
> 

***********************************************************
CAUTION: This email and files included in its transmission 
are solely intended for the use of the addressee(s) and may 
contain information that is confidential and privileged. 
If you receive this email in error, please advise us 
immediately and delete it without copying the contents 
contained within. Woolworths Limited (including its group 
of companies) do not accept liability for the views 
expressed within or the consequences of any computer 
viruses that may be transmitted with this email. The 
contents are also subject to copyright. No part of it 
should be reproduced, adapted or transmitted without the 
written consent of the copyright owner.
***********************************************************

Reply via email to