Hi,

i think i found the problem. The problem is the guy writing this
eMail :-)

Actually everything is completely right, my mind just wanted to have
a different output via the log messages.

Explanation:

In the first test run, we didn't reach the aimed goal, because the
complete cycle took about 70ms and our app waited for completion.

The printer producer told use we don't have to wait for the completion
message we just could keep going on, Because the response message isn't
of high priority of the printer an will be delayed if other important
messages must be processed.

So we changed our app, to not wait for the completion and just to keep
going forward with our internal processing.

And somehow my mind thought that the change to our app also improves the
response time of the printer. Arghhhh.

But thanks for any made suggestion and help.

Best regards

Max Larsson




On 24.02.14 08:21, Emmanuel Lécharny wrote:
Le 2/24/14 8:06 AM, Max Larsson a écrit :
Hi,
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).

you mean it takes 2ms to process a message on your server ? What are you
doing during the processing (2ms is a very long period)

Calculating the next set of data for the printer including some database
queries.

Ah ! That explains the 2ms then. That does not explain the 70ms needed
to write the data...

As state already
session.write -> NioPorcessor messageSent takes about 70ms.

Have you enabled the Nagle algorithm ? Are you using half-duplex
network ?


Full Duplex. setTcpNoDelay is set to true
ok. Eliminated the obvious...



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.

As soon as you write something, this will trigger an event which will be
processed. There is no delay here.

What you should do at this point is to use Wireshark to see what's
really going on at the network level. You should be able to see how long
it takes to write a response after a request has been received.

One of the next task this week to check :-)

But as it seems, at least i'm using mina correctly.

I don't have your code, but yes. I don't see anything atrocious done here.

Have you some log in your code ?



--
------------------------------------------------------
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