Hi there,

Have you tried setting a higher value for backlog yet?
It's a parameter that you can tune around with in SocketAcceptorConfig,
which determines how many incoming TCP connections your underlying system
would try to queue up if no enough resources can be allocated to handle
these connection requests. If such a limit is reached, further requests
could be dropped. Since you mentioned connection requests were arriving in a
small time frame, I have a strong feeling this parameter is the cause.

Please See "Note about socket backlogs" section on this page for more
details.
http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html

Cheers,
Qi


chinadeng wrote:
> 
> server can not detect the 60 connections,not session closed(session is not
> opened at all),
> in other word ,when 300 clients connect ,server only can hanlder  parts of
> clients(not all clients) 
> 
> Trustin Lee wrote:
>> 
>> What do you mean by 'discarded'?  Are the 60 connections get closed?
>> Are you notified with sessionOpened or sessionClosed?
>> 
>> Trustin
>> 
>> On Dec 20, 2007 11:48 AM, chinadeng <[EMAIL PROTECTED]> wrote:
>>>
>>>   Hi:
>>>  when 300 client connect to my servers at almost in same time ,but the
>>> server only can handle 240 client ,60 client will be discarded.
>>> my server codes like fellowing :
>>>   InetSocketAddress serverAddress1 = new InetSocketAddress(8008);
>>>         DemuxingProtocolCodecFactory dpcf = new
>>> DemuxingProtocolCodecFactory();
>>>
>>>            dpcf.register(new CliEntCmdDeconder());
>>>            dpcf.register(new CliEntEncoder());
>>>
>>>            SocketAcceptor acceptor = new
>>> SocketAcceptor(Runtime.getRuntime().availableProcessors() + 1,
>>>                         Executors.newCachedThreadPool());
>>>
>>>         SocketAcceptorConfig cfg = new SocketAcceptorConfig();
>>>         cfg.setReuseAddress(true);
>>>         DefaultIoFilterChainBuilder chain = cfg.getFilterChain();
>>>         chain.addLast("logger", new LoggingFilter());
>>>         chain.addLast("protocol", new ProtocolCodecFilter(dpcf));
>>>         System.out.println("long on ....");
>>>         DemuxingIoHandler iohanlder=new DemuxingIoHandler();
>>>
>>>      iohanlder.addMessageHandler(clicmdbro.class, new
>>> CliEntCmdHandler(testb));
>>>
>>>         try
>>>                 {
>>>                         acceptor.bind(serverAddress1,iohanlder, cfg);
>>>                 } catch (IOException e)
>>>                 {
>>>                         // TODO Auto-generated catch block
>>>                         e.printStackTrace();
>>>                 }
>>>   how can i  ressolve the problem??
>>> Thanks in Advance
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-can-i-improve-the-total-numbers-of-session-which-server-will--handle-connects-from-client-tp14429723s16868p14429723.html
>>> Sent from the Apache MINA Support Forum mailing list archive at
>>> Nabble.com.
>>>
>> 
>> 
>> 
>> -- 
>> what we call human nature is actually human habit
>> --
>> http://gleamynode.net/
>> --
>> PGP Key ID: 0x0255ECA6
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-can-i-improve-the-total-numbers-of-session-which-server-will--handle-connects-from-client-tp14429723s16868p14431567.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.

Reply via email to