On 3/13/07, mrGibby <[EMAIL PROTECTED]> wrote:
330k tps is a very large number.. honestly it is hard for me to believe that you can get such results with single jvm (or did the test have multiple hosts and jvm's). But if it can I am really impressed. Would be nice to see some hardware specs and details on the actual test. I have to run some tests with our hosts that have a bit more juice.. Anyway, 10k tps with single jvm is sufficient for me.
Oops, I made a mistake. It was 220k msgs/sec. Please refer to the page 7 of the following presentation material: http://mina.apache.org/documentation.data/ACAsia2006.pdf It was single JVM AFAIK. The performance test has been performed by Robert Greg, a committer of Qpid project (formerly AMQP, currently under incubation). Interestingly, the Java implementation based on MINA outperformed the C++ implementation by twice IIRC.
Anyway, here is the code: // Create an acceptor IoAcceptor acceptor = new SocketAcceptor(20, Executors.newCachedThreadPool()); // Create a service configuration SocketAcceptorConfig cfg = new SocketAcceptorConfig(); cfg.setReuseAddress( true ); cfg.setThreadModel(ThreadModel.MANUAL); cfg.getFilterChain().addLast( "protocolFilter", new ProtocolCodecFilter( new DiameterProtocolCodecFactory() ) ); //cfg.getFilterChain().addLast( "logger", new LoggingFilter() ); //cfg.getFilterChain().addLast("threadPool", new ExecutorFilter(Executors.newFixedThreadPool(10))); ByteBuffer.setUseDirectBuffers (false); ByteBuffer.setAllocator(new SimpleByteBufferAllocator()); acceptor.bind( new InetSocketAddress( port ), new ServerHandler(), cfg );
The code looks OK to me. It seems like unfair I/O problem in MINA is worse than I thought initially. Let me investigate this issue further when I have more free time. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6