You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by xmuysa <xm...@tom.com> on 2009/11/10 03:51:27 UTC
The performance of mina
Hi,
In our project,we need the performance of socket more than 500tps,
As a matter of fact,everything has not ckome out as we wanted.
63tps:
Mina Server:
SocketAcceptor acceptor = new NioSocketAcceptor(Runtime.getRuntime()
.availableProcessors());
acceptor.getFilterChain().addLast("tcp", new TCPFilter());
acceptor.getFilterChain().addLast("codec",
new ProtocolCodecFilter(new MessageCodecFactory()));
acceptor.getFilterChain().addLast("threadPool",
new ExecutorFilter(Executors.newCachedThreadPool()));
acceptor.setHandler(new ServerSessionHandler());
acceptor.getSessionConfig().setReadBufferSize(2048);
acceptor.getSessionConfig().setTcpNoDelay(true);
acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 600);
acceptor.bind(new InetSocketAddress(port));
How can i do?
Best regard
Yours faithfully
2009-11-10
yangshian
Re: The performance of mina
Posted by Emmanuel Lecharny <el...@apache.org>.
xmuysa wrote:
> Hi,
>
> In our project,we need the performance of socket more than 500tps,
>
FYI, on my laptop, I get 4500 LDAP requests per second using Apache
Directory Server, and we went up to 13 000 requests per second on a 4
way CPU computer. And trust me, LDAP is a pretty expensive protocol. (we
are using MINA 2.0)
Looking at your base config, I see nothing wrong about it. Now, you have
many areas where you'll like to check :
- Handler : no matter what you do with MINA, Handler is where the CPU is
eaten. The ration Handler/MINA is probably something like 95%/5%. Check
your handlers to see if this is not the place you can get some
performance improvement
- Network : slow network, firewall, badly configured routers, are also
another performance killer.
This is pretty much all I can tell you so far.
But in any case, 500 Tps is basically not a problem for MINA *alone*.
Check your own code or your network...
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org