Dear Trustin,I traced the stack traces then I found there were many connections closed normally, which could be my test clients' problems and the 'Connection rest' as you mentioned to upgrade my hardware,the followed descriptions are about my hard&soft-ware
environment. Linux version 2.6.9-22.ELsmp (gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)) JDK 1.5.6 MINA 1.0 2 GB RAM 1 XeonWhen I finished my test procedure which means I make the test clients closed then I traced there were no connections bound to my server,when I restart my server then 'Address Already In Use' exception was thrown,by the command 'netstat' I found there are several
connections stuck in CLOSE_WAIT......the reuseAddress and unbindAll were both enabled and definitely be invoked in my server...So...It's so wired,which has been troubling me until NOW
please help me out....
IoAcceptorConfig config = new SocketAcceptorConfig();
config.setDisconnectOnUnbind(true);
config.getFilterChain().addLast("codec",
((SocketAcceptorConfig) config).setReuseAddress(true);
acceptor.bind(new InetSocketAddress(PORT), new ProtocolHandler(),config);
AND for every incoming connection
public void sessionCreated(IoSession session)
{
if (session.getTransportType() == TransportType.SOCKET)
{
((SocketSessionConfig) session.getConfig()).setReuseAddress(true);
}
}
----- Original Message -----
From: "Trustin Lee" <[EMAIL PROTECTED]>
To: <[email protected]> Sent: Tuesday, October 24, 2006 10:33 AM Subject: Re: Experiences with bulk connections
Hi James, On 10/20/06, 凌晨 <[EMAIL PROTECTED]> wrote:Just yesterday I did almost the same test.Established 1000 connections per second and 20000 at all,every connetion sent small data package as soon asconnected to register itself to theserver(HashMap<String,Iosession>).During the whole procedure,many a formerconnected IoSession stored in HashMap had been closed abnormally and unexpectedly and there only no more than200 connections remained in HashMap at last.I have been revising my codesPlease give us a few stack traces you've got during the test. If they are just regular SocketExceptions like 'connection reset', it's caused by your O/S or network device and this means we cannot fix it. You will have to adjust your O/S parameter or upgrade your hardware. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6
