I digg some thing ,my business logic will take 5 seconds to complete the
request(after messageReceived () method of handlerClass ).
so server not able to send the response back or not able to receive the
remaining requests.
I think u understand the scenario.





On Wed, Jul 1, 2009 at 9:25 AM, Kumar Phani <[email protected]> wrote:

>
>
> Thanks elecharny <[email protected]>,
>
> I think Its working with taking MultiThreads.
>
> But the new problem is,
>
> 1.when Client sends the request to the Server(which is implemented using
> MINA).
> 2.Server receives the request and forward that to another IP address(which
> is the business logic).
> 3.In order to complete the single request(From server to another IP) it
> nearly takes 4 seconds.
> 4.later it able to respond back with proper rsponse to client.
>
> In that case it is will not process morethan 2 requests.
>
>
>
> On Wed, Jul 1, 2009 at 8:00 AM, Kumar Phani <[email protected]> wrote:
>
>> Hi,
>>
>>
>> Server is taking only 2 request for 3rd request it is not not able to
>> process ,I thought that my system is dualCore .
>> I wrote a client which is multithreaded and can able to generate 5
>> requests at a time.
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Jun 30, 2009 at 7:51 PM, Emmanuel Lecharny 
>> <[email protected]>wrote:
>>
>>> Kumar Phani wrote:
>>>
>>>> Hi ,
>>>>
>>>>
>>>>
>>>>
>>>> --------------------------------------------------------------------------------------------Code--------------------------------------
>>>>
>>>>
>>>> acceptor = new
>>>> NioSocketAcceptor(Runtime.getRuntime().availableProcessors()
>>>> + 1);
>>>>
>>>>
>>> Duplicate effort. new NioSocketAcceptor() will create the same thing.
>>>
>>>>
>>>>        DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
>>>>        acceptor.setReuseAddress(true);
>>>>
>>>>        ThreadPoolExecutor threadPool = new
>>>> ThreadPoolExecutor(1000,2000,600L,
>>>>                TimeUnit.SECONDS,new
>>>> ArrayBlockingQueue<Runnable>(1000),new
>>>>                ThreadPoolExecutor.CallerRunsPolicy());
>>>>        int threadNum = threadPool.prestartAllCoreThreads();
>>>>        log.debug("Number of Threads---"+threadNum);
>>>>
>>>>
>>>>
>>>>        acceptor.getFilterChain().addFirst("log", new LoggingIOFilter());
>>>>        acceptor.getFilterChain().addLast(
>>>>            "protocol"
>>>>        ,    new ProtocolCodecFilter(new GRTxCodecFactory())
>>>>        );
>>>>        chain.addLast("threadPool", new ExecutorFilter(threadPool));
>>>>        acceptor.setHandler( new GRTxServerHandler(this, listener));
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------------------------------Code--------------------------------------
>>>>
>>>> Actually I am trying with this code after your valuable suggestion.
>>>> Correct me if I am wrong..
>>>> But it is not taking Multiple Client requests simultaneoulsy.
>>>>
>>>>
>>> What exactly conduct you to think that the server does not take multiple
>>> client requests simultanously ?
>>>
>>> --
>>> --
>>> cordialement, regards,
>>> Emmanuel Lécharny
>>> www.iktek.com
>>> directory.apache.org
>>>
>>>
>>>
>>
>

Reply via email to