Did you put:

ByteBuffer.setUseDirectBuffers(false);  // Direct buffers perform bad.
ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); // Disables
pooling.


It helps.

2007/4/24, Kumaran Arul <[EMAIL PROTECTED]>:


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