Hi,

>> The logs i based my investigation on are from a a stress test. And
the external measurement has the same result.

Actually the timing from receiving,proceesing,session.write the commands
is very constant on my side (~2ms). The time between session.write and
messageSent event is normally about 70ms, but sometime the elapsed
time is very low (~2ms). And because the aim is to reach a complete
command/response cycle within 10ms, i'm trying to figure out why
mina is taking so long to process from session.write to messageSent.

Can you tell us a bit more on :
- the OS you are running (client and server)
- the network bandwith
- the message (received and sent) size

2ms is slow if you transit small messages. FTR, on a 10 Mbs network, you
should be able to transmit 10000 messages of 100 bytes per second, mor
or less, with a latency below 1ms. And 70ms is extremelly slow...

The message response is about 300-400 bytes, no really big. The received
command even more less ~100 bytes. The network is 100Mbs.

The stress test was made with two different setup one being a MacBookPro
2011 with our software running under Mac OS 19.1. And a windows laptop
with a virtual machine running a linux application, doing the same task,
as our implementation. (Our application shall replace the linux one).

And the device we are talking to is a printer, later a bit more information.
The linux app performed twice as any request per minutes, than our.
So i don't think the network setup is the bottleneck (yet)

I donn't even think the different OSes are a cause. It have to do
somethink with my code and/or how i uses mina. See below.

FYI, I'm able to handle more than 13 000 LDAP message per second on a
100 Mb/s network, on a 2011 MacBookPro...

I only have to reach 8000 messages per / *minute* :-) So should be
a task doable.

A little Background:

The printer send upon each print cycle the following command:

 Print Triggered -> Started -> Ended

Upon receiving Started, our app has to to respond with a new
set of data to print. The processing of this takes about ~2ms.
(NioPreccossor recievedMessage -> session.write). As state already
session.write -> NioPorcessor messageSent takes about 70ms.

Additional some background how our IoHandler is implemented.
In the messageReceived we check if the message is send to us
as result upon command send to the printer or if it is a message
send to us triggered by a print cycle. If it is from the print cycle
we use another thread to dispatch an internal event in our event.
This thread process the message and prepares the next set of data
to print and writes it with session.write out.
After digging a lot around i have a feeling thats the cause of the
long delay? Because (IMHO) i think during preparing the reponse, the
NioPreccssor Thread keep going, doesn't see anything to write, goes to
check for reading next message and doesn't get the desired attention
when the writeQueue gets filled.

Best regards

Max Larsson








--
------------------------------------------------------
http://facilityboss.biz
http://facebook.com/facilityboss
------------------------------------------------------
facilityboss GmbH
Rheinstraße 75
64295 Darmstadt / Germany
Handelsregister Darmstadt, HRB 86193
Geschäftsführer: Dipl.-Inform. Max Lars Robert Larsson

Mobil: +49 179 218 4428
Email: [email protected]

Reply via email to