I've had a similar issue on my linux box ( ubuntu 8.04 ). I use TCP 
connections, though.
It was in fact due to security limits

in the file /etc/security/limits, I added 

*               soft    nofile          100000
*               hard    nofile          100000
 
This solved the issue. I've gone above 30k connections.

/Strand


-----Original Message-----
From: Richard [mailto:[EMAIL PROTECTED]
Sent: Fri 2008-10-17 11:03
To: [email protected]
Subject: tuning app with large number of UDP sessions
 
Hi

I am new to MINA and I have a slightly unusual application. I am hoping
that someone can give me some advice on the best way to optimise MINA's
performance.

I have a server for a UDP protocol for which I have implemented a
handler, decoder, encoder etc. The server works just fine.

But I want to run the protocol on a large number of UDP ports to support
 lots of clients, each with their own port number for talking to my
server. (I would not have designed it this way, but I do not have
control of the client implementation).

So I took the, possibly naive, approach of just looping over the
following code many times to start lots of listeners:


acceptor = new DatagramAcceptor();
acceptor.getDefaultConfig().getSessionConfig().setReuseAddress(true);

DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
                chain.addLast("", new LoggingFilter());
                chain.addLast("codec", new ProtocolCodecFilter(                 
                        new CodecFactory()));
                acceptor.bind(new InetSocketAddress(udp_port), new 
Handler(this));

The only other MINA options that I am setting are:

ByteBuffer.setUseDirectBuffers(false);
ByteBuffer.setAllocator(new SimpleByteBufferAllocator());

Using this approach I am able to create 250 instances of my server
before I start to get errors. I think that the errors are either file
descriptor limits or memory problems because of the number of threads
that are being created ~500.

Can anyone offer any advice on how I can best setup MINA to handle this
type of application? I would like to listen on 1000+ UDP ports.


Many thanks

Richard


Reply via email to