HI 
Recently I have experience something very weird when using Mina core 2 m1 as
my application network infrastructure. the thing is that my Mina Connector's
IoSession can not write and read simultaneously under heavy write and read
load.

Here is my situation:
1. I develop a Web service based application on JBoss Application
Server(let's say, serverA). The Web Service Method (let's say, methodA) have
to handle invocations or requests from hundreds of, or maybe thousands of,
clients.
2. And, methodA handle those invocations by just create some specific XML
messages, and send them to another Server (let's say, serverB). 
3. I use NioSocketConnector in serverA to implement the connection with
serverB. this means the serverA is client, serverB is the socket server, and
there is only one session between them.
4. In methodA, I use the only IoSession to send all the XML messages to
serverB. the code is like below:
        Client.getSession().write((Object) xmlMessage);
5. I have a IoHandler for the NioSocketConnector called MyIoHandler. The
main job of it is to handle all the response XML message in
MyIoHandler.messageReceived(). 


While doing the performance test, I simulate 200 concurrent virtual users to
continuously call methodA. and the result is       
that methodA swallow  all the request from the virtual users, and
successfully write those XML message using session.write(). But the problem
is that MyIoHandler.messageReceived() was not acted as I expected. It only
handle very small amount of messages, and most of the response messages from
serverB are queued in the Mina's internal queue. If I stop all the virtual
users, the  MyIoHandler.messageReceived() will resume the power, and begin
to handle. 

This is very strange, because my server's CPU usage is only about 40% during
the test, and it acted as IoSession can not write and read simultaneously
under heavy write and read load.

I try to use    connector.getSessionConfig().setUseReadOperation(true) and
call the session.read() after I write.  Although it can make the session
write and read simultaneously, but the performance decreased dramatically. 

Questions:
1. Can anyone tell me what's the reason of all above, or does someone know
how to fix it and make the server handle read and write all together?
2. Do I need to synchronized the session?

BTW, I am use java 1.5, mina 2.0m1, and jboss4.2.2. and I already disable
the ExecutorFilter.

Thnak you in advance and Happy new year!



-- 
View this message in context: 
http://www.nabble.com/My-Connector%27s-IoSession-can-not-write-and-read-simultaneously-under-heavy-write-and-read-load.-tp14704200s16868p14704200.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.

Reply via email to