On 3/13/07, SmartOliver <[EMAIL PROTECTED]> wrote:
on Window NT server 2003, with a 1gbits/s network, I've used MINA1.0 to
developp a TCP server that hold the persistence connections of the hundreds
of clients.
The acceptor is configured as follow :
IoAcceptor ioAcceptor = new
SocketAcceptor(Runtime.getRuntime().availableProcessors() + 1,
Executors.newCachedThreadPool());
//Thread pool filter
ExecutorFilter executorFilter = new
ExecutorFilter(Executors.newFixedThreadPool(16))
ioAcceptor.getFilterChain().addLast("ThreadPool", executorFilter);
IoServiceConfig serviceConfig = (IoServiceConfig)
ioAcceptor.getDefaultConfig().clone();
serviceConfig.setThreadModel(ThreadModel.MANUAL);
SocketSessionConfig socketSessionConfig =
(SocketSessionConfig)serviceConfig.getSessionConfig() ;
socketSessionConfig.setTcpNoDelay(true);
socketSessionConfig.setKeepAlive(true);
socketSessionConfig.setReceiveBufferSize(2048);
socketSessionConfig.setReuseAddress(false);
socketSessionConfig.setSendBufferSize(2048);
When the acceptor sends 2.1 mbytes/second (20 messages per second to 300
clients (messages average length is 350 bytes)), the throuput is good ( a
message takes less than 3 ms to be received by a client).
So the problem is that, suddenly, with the increasing of client number (from
320 clients), the server throughput decreases : messages crossing time
increases continuously ( > 1 second per message !). Nevertheless, brandwith
is used under 2.5% both side.
Is the acceptor configuration correct for such a use case?
Shall I use another Thread strategy ?
Does anyone have experience in this field? Any help will be appreciated.
Please mention your JVM details as well.
Guys, I think we need to mention upfront that for getting the best
performance out of MINA, epoll support is NECESSARY. That would mean
using JDK 1.5-Update 10 upwards with epoll support enabled using the
"-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.EPollSelectorProvider"
flag, or using JDK 1.6.
Regards,
Vinod.